Interface SortAgnostic
- All Known Implementing Classes:
Aggregate,Completion,Dissect,Drop,Enrich,EsqlProject,Eval,Filter,Grok,InferencePlan,InlineJoin,InlineStats,Join,Keep,Lookup,LookupJoin,MvExpand,OrderBy,Project,RegexExtract,Rename,Rerank
An example is with commands that compute values record by record, regardless of the input order and that don't rely on the context (intended as previous/next records).
Example 1: if a MY_COMMAND that implements this interface is used between two sorts, then we can assume that
| SORT x, y, z | MY_COMMAND | SORT a, b, c
is equivalent to
| MY_COMMAND | SORT a, b, c
Example 2: commands that make previous order irrelevant, eg. because they collapse the results; STATS is one of them, eg.
| SORT x, y, z | STATS count(*)
is equivalent to
| STATS count(*)
and if MY_COMMAND implements this interface, then
| SORT x, y, z | MY_COMMAND | STATS count(*)
is equivalent to
| MY_COMMAND | STATS count(*)
In all the other cases, eg. if the command does not implement this interface then we assume that the previous SORT is still relevant and cannot be pruned.
Eg. LIMIT does not implement this interface, because
| SORT x, y, z | LIMIT 10 | SORT a, b, c
is NOT equivalent to
| LIMIT 10 | SORT a, b, c
For n-ary plans that implement this interface, we assume that the above applies to all the children