Uses of Interface
io.trino.sql.planner.iterative.Rule
Packages that use Rule
Package
Description
-
Uses of Rule in io.trino.execution.querystats
Methods in io.trino.execution.querystats with parameters of type RuleModifier and TypeMethodDescriptionvoidPlanOptimizersStatsCollector.recordFailure(Rule<?> rule) voidPlanOptimizersStatsCollector.recordRule(Rule<?> rule, boolean invoked, boolean applied, long elapsedNanos) -
Uses of Rule in io.trino.sql.planner
Methods in io.trino.sql.planner that return types with arguments of type RuleMethods in io.trino.sql.planner with parameters of type RuleMethod parameters in io.trino.sql.planner with type arguments of type Rule -
Uses of Rule in io.trino.sql.planner.iterative
Methods in io.trino.sql.planner.iterative that return types with arguments of type RuleModifier and TypeMethodDescriptionRuleIndex.getCandidates(Object object) IterativeOptimizer.getRules()Methods in io.trino.sql.planner.iterative with parameters of type RuleMethod parameters in io.trino.sql.planner.iterative with type arguments of type RuleModifier and TypeMethodDescriptionConstructor parameters in io.trino.sql.planner.iterative with type arguments of type RuleModifierConstructorDescriptionIterativeOptimizer(PlannerContext plannerContext, RuleStatsRecorder stats, StatsCalculator statsCalculator, CostCalculator costCalculator, Predicate<Session> useLegacyRules, List<PlanOptimizer> legacyRules, Set<Rule<?>> newRules) IterativeOptimizer(PlannerContext plannerContext, RuleStatsRecorder stats, StatsCalculator statsCalculator, CostCalculator costCalculator, Set<Rule<?>> rules) -
Uses of Rule in io.trino.sql.planner.iterative.rule
Classes in io.trino.sql.planner.iterative.rule that implement RuleModifier and TypeClassDescriptionclassAdds INTERMEDIATE aggregations between an un-grouped FINAL aggregation and its preceding PARTIAL aggregation.classclassclassThis rule finds correlated UnnestNode in CorrelatedJoinNode's subquery and folds them into UnnestNode representing LEFT JOIN UNNEST.classThis rule finds correlated UnnestNode in CorrelatedJoinNode's subquery and folds them into UnnestNode representing LEFT JOIN UNNEST.classThis rule decorrelates plans with correlated UnnestNode and optional EnforceSingleRowNode, optional LimitNode, optional TopNNode and optional projections in the subquery.classclassThis rule must run after the distribution type has already been set for delete queries, since semi joins in delete queries must be replicated.classclassclassConverts an Intersect node with at least one empty branch to an empty Values node.classReplaces 0% sample node with empty values node.classTransforms:static final classstatic final classstatic classstatic classclassTransforms:classImplement EXCEPT ALL using union, window and filter.classConverts EXCEPT DISTINCT queries into UNION ALL..GROUP BY...WHERE E.g.:classImplements filtered aggregations by transforming plans of the following shape:classImplement INTERSECT ALL using union, window and filter.classConverts INTERSECT DISTINCT queries into UNION ALL..GROUP BY...WHERE E.g.:classTransforms:classTransforms:classThis rule prepares cartesian product of partitions from all inputs of table function.classReplace filter predicate conjuncts with underlying project expressions.classInlines expressions from a child project node into a parent project node as long as they are simple constants, or they are referenced only once (to avoid introducing duplicate computation) and the references don't appear within a TRY block (to avoid changing semantics).classclassclassTransforms:classTransforms:classThis rule handles both LimitNode with ties and LimitNode without ties.classclassclassThis rule handles both LimitNode with ties and LimitNode without ties.static final classstatic final classclassTransforms:classTransforms:classImplements distinct aggregations with different inputs by transforming plans of the following shape:classFor empty aggregations duplicate input rows can be skipped.classclassRule that transforms selected aggregations from:classProjectOffPushDownRule<N extends PlanNode>classclassclassThis rule restricts the outputs of ApplyNode's input and subquery based on which ApplyNode's output symbols are referenced.classThis rule updates ApplyNode's correlation list.classThis rule restricts outputs of ApplyNode's subquery to include only the symbols needed for subqueryAssignments.classclassThis rule restricts the outputs of CorrelatedJoinNode's input and subquery based on which CorrelatedJoinNode's output symbols are referenced.classThis rule updates CorrelatedJoinNode's correlation list.classA count over a subquery can be reduced to a VALUES(1) provided the subquery is a scalarclassclassclassclassclassThis rule restricts the outputs of ExchangeNode based on which ExchangeNode's output symbols are either referenced by the parent node or used for partitioning, ordering or as a hash symbol by the ExchangeNode.classclassclassclassThis rule prunes GroupIdNode's aggregationArguments.classclassclassclassclassJoins support output symbol selection, so make any project-off of child columns explicit in project nodes.classJoins support output symbol selection, so absorb any project-off into the node.classclassclassclassclassclassclassclassThis rule restricts the inputs to PatternRecognitionNode based on which symbols are used by the inner structures of the PatternRecognitionNode.classclassclassclassclassclassclassclassSpatial joins support output symbol selection, so absorb any project-off into the node.classclassTableFunctionProcessorNode has two kinds of outputs: - proper outputs, which are the columns produced by the table function, - pass-through outputs, which are the columns copied from table arguments.classThis rule prunes unreferenced outputs of TableFunctionProcessorNode.classThis is a special case of PushProjectionIntoTableScan that performs only column pruning.classclassclassclassTransformsclassclassAbsorb pruning projection into the node.classclassclassclassclassThis optimizer pushes aggregations below outer joins when: the aggregation is on top of the outer join, it groups by all columns in the outer table, and the outer rows are guaranteed to be distinct.classclassTransforms:classTransforms:classTransforms:classTransforms:classTransforms:classTransforms:classTransforms:classTransforms:classTransforms:classTransforms:classTransforms:classTransforms:classTransforms:classclassclassclassclassAggregate functions in pattern recognition context have special semantics.static final classstatic final classclassclassclassclassTransforms:classTransforms:classclassclassTransforms:classclassThis version support only constant updates and fall back to default behaviour in all other casesclassTransforms:classclassclassThese rules should not be run after AddExchanges so as not to overwrite the TableLayout chosen by AddExchangesclassThis rule pushes filter predicate concerning row number symbol into RowNumberNode by modifying maxRowCountPerPartition.classThis rule pushes filter predicate concerning a ranking symbol into WindowNode by converting it into TopNRankingNode.classclassTransforms:classfinal classPushes RemoteExchange node down through the AssignUniqueId to preserve partitioned_on(unique) and grouped(unique) properties for the output of the AssignUniqueId.classclassclassclassTransforms:final classTransforms:classclassRemove the aggregation node that produces distinct rows from the Filtering source of a Semi join.classRemoves branches from an ExceptNode that are guaranteed to produce 0 rows.classclassIf the predicate for a table execute is optimized to false, the target table scan of table execute will be replaced with an empty values node.classRemoves branches from a UnionNode that are guaranteed to produce 0 rows.classRemoves 100% sample nodes.classReplace DistinctLimit node 1.classclassGiven:classRemoves projection nodes that only perform non-renaming identity projectionsclassclassRemove Limit node when the subplan is guaranteed to produce fewer rows than the limit and replace the plan with empty values if the limit count is 0.classRemove Offset node and its subplan when the subplan is guaranteed to produce no more rows than the offset and replace the plan with empty values.classclassclassThis rule removes SortNode being a source of LimitNode with ties.classTable function can take multiple table arguments.classReplace TopN node 1.classclassclassclassclassclassThis rule transforms plans with join where one of the sources is a single-row ValuesNode, and the join condition is `on true`.classThis rule is complementary to RemoveRedundantJoin.classThis rule transforms plans with joins, where: - one of the sources is scalar and produces no output symbols.classclassRe-writes spatial_partitioning(geometry) aggregations into spatial_partitioning(envelope, partition_count) on top of ST_Envelope(geometry) projection, e.g.classclassclassSimplify conditional expressions in filter predicate.classImplements distinct aggregations with similar inputs by transforming plans of the following shape:classThis rule decorrelates a correlated subquery of LEFT correlated join with distinct operator (grouped aggregation with no aggregation assignments) It is similar to TransformCorrelatedDistinctAggregationWithProjection rule, but does not support projection over aggregation in the subqueryclassThis rule decorrelates a correlated subquery of LEFT correlated join with distinct operator (grouped aggregation with no aggregation assignments)classThis rule decorrelates a correlated subquery with: - single global aggregation, or - global aggregation over distinct operator (grouped aggregation with no aggregation assignments), in case when the distinct operator cannot be de-correlated by PlanNodeDecorrelator It is similar to TransformCorrelatedGlobalAggregationWithProjection rule, but does not support projection over aggregation in the subqueryclassThis rule decorrelates a correlated subquery of LEFT or INNER correlated join with: - single global aggregation, or - global aggregation over distinct operator (grouped aggregation with no aggregation assignments), in case when the distinct operator cannot be de-correlated by PlanNodeDecorrelatorclassThis rule decorrelates a correlated subquery of INNER correlated join with: - single grouped aggregation, or - grouped aggregation over distinct operator (grouped aggregation with no aggregation assignments), in case when the distinct operator cannot be de-correlated by PlanNodeDecorrelator It is similar to TransformCorrelatedGroupedAggregationWithProjection rule, but does not support projection over aggregation in the subqueryclassThis rule decorrelates a correlated subquery of INNER correlated join with: - single grouped aggregation, or - grouped aggregation over distinct operator (grouped aggregation with no aggregation assignments), in case when the distinct operator cannot be de-correlated by PlanNodeDecorrelatorclassReplaces correlated ApplyNode with InPredicate expression with SemiJoinclassTries to decorrelate subquery and rewrite it using normal join.classScalar filter scan query is something like:classThis optimizer can rewrite correlated single row subquery to projection in a way described here: From:classEXISTS is modeled as (if correlated predicates are equality comparisons):classRewrite filtering semi-join to inner join.classThis optimizers looks for InPredicate expressions in ApplyNodes and replaces the nodes with SemiJoin nodes.classclassGiven x::row(t) and y::row(t), converts assignments of the formclassRule that transformsMethods in io.trino.sql.planner.iterative.rule that return RuleModifier and TypeMethodDescriptionRule<?> ExpressionRewriteRuleSet.aggregationExpressionRewrite()Rule<?> ExpressionRewriteRuleSet.filterExpressionRewrite()Rule<?> ExpressionRewriteRuleSet.joinExpressionRewrite()Rule<?> ExpressionRewriteRuleSet.patternRecognitionExpressionRewrite()Rule<?> ExpressionRewriteRuleSet.projectExpressionRewrite()PushInequalityFilterExpressionBelowJoinRuleSet.pushJoinInequalityFilterExpressionBelowJoinRule()PushInequalityFilterExpressionBelowJoinRuleSet.pushParentInequalityFilterExpressionBelowJoinRule()Rule<?> ExpressionRewriteRuleSet.valuesExpressionRewrite()Methods in io.trino.sql.planner.iterative.rule that return types with arguments of type RuleModifier and TypeMethodDescriptionAddDynamicFilterSource.rules()AddExchangesBelowPartialAggregationOverGroupIdRuleSet.rules()ArraySortAfterArrayDistinct.rules()ExpressionRewriteRuleSet.rules()ExtractSpatialJoins.rules()GatherAndMergeWindows.rules()MergePatternRecognitionNodes.rules()PushFilterThroughCountAggregation.rules()PushInequalityFilterExpressionBelowJoinRuleSet.rules()RemoveEmptyMergeWriterRuleSet.rules()SimplifyExpressions.rules()