Class PushDownLimitAndOrderByIntoFork
java.lang.Object
org.elasticsearch.xpack.esql.rule.Rule<Limit,LogicalPlan>
org.elasticsearch.xpack.esql.rule.ParameterizedRule<Limit,LogicalPlan,LogicalOptimizerContext>
org.elasticsearch.xpack.esql.optimizer.rules.logical.OptimizerRules.ParameterizedOptimizerRule<Limit,LogicalOptimizerContext>
org.elasticsearch.xpack.esql.optimizer.rules.logical.PushDownLimitAndOrderByIntoFork
public class PushDownLimitAndOrderByIntoFork
extends OptimizerRules.ParameterizedOptimizerRule<Limit,LogicalOptimizerContext>
Pushes down any SORT + LIMIT (TopN) that appear immediately after a FORK, into the FORK branches that have no pipeline breaker.
In the following example, assuming no FORK implicit limit is added, both FORK branches are missing a pipeline breaker:
By pushing down (TopN) in both branches, we reduce the number of rows that are returned to the coordinator.
FROM my-index
| FORK (WHERE x) (WHERE y)
| SORT z
| LIMIT 10
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LogicalPlanrule(Limit limit, LogicalOptimizerContext context) Methods inherited from class org.elasticsearch.xpack.esql.optimizer.rules.logical.OptimizerRules.ParameterizedOptimizerRule
applyMethods inherited from class org.elasticsearch.xpack.esql.rule.ParameterizedRule
apply
-
Constructor Details
-
PushDownLimitAndOrderByIntoFork
public PushDownLimitAndOrderByIntoFork()
-
-
Method Details
-
rule
- Specified by:
rulein classOptimizerRules.ParameterizedOptimizerRule<Limit,LogicalOptimizerContext>
-