Class RemoveRedundantTopN

java.lang.Object
io.trino.sql.planner.iterative.rule.RemoveRedundantTopN
All Implemented Interfaces:
Rule<TopNNode>

public class RemoveRedundantTopN extends Object implements Rule<TopNNode>
Replace TopN node 1. With a Sort node when the subplan is guaranteed to produce fewer rows than N 2. With its source when the subplan produces only one row 3. With a empty ValuesNode when N is 0