Class MergeLimitWithTopN
java.lang.Object
io.trino.sql.planner.iterative.rule.MergeLimitWithTopN
This rule handles both LimitNode with ties and LimitNode without ties.
In the case of LimitNode with ties, the LimitNode is removed
if only its row count equals or exceeds TopNNode's row count:
- Limit (5, with ties)
- TopN (3)
is transformed into:
- TopN (3)
In the case of LimitNode without ties, the LimitNode is removed,
and the TopNNode's row count is updated to minimum row count
of both nodes:
- Limit (3)
- TopN (5)
is transformed into:
- TopN (3)
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.trino.sql.planner.iterative.Rule
Rule.Context, Rule.Result -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(LimitNode parent, Captures captures, Rule.Context context) Returns a pattern to which plan nodes this rule applies.