| AddExchangesBelowPartialAggregationOverGroupIdRuleSet |
Transforms
|
| AddIntermediateAggregations |
Adds INTERMEDIATE aggregations between an un-grouped FINAL aggregation and its preceding
PARTIAL aggregation.
|
| ApplyPreferredTableExecutePartitioning |
|
| ApplyPreferredTableWriterPartitioning |
Rule verifies if preconditions for using preferred write partitioning are met:
- expected number of partitions to be written (based on table stat) is greater
than or equal to preferred_write_partitioning_min_number_of_partitions session property,
- use_preferred_write_partitioning is set to true.
|
| ApplyTableScanRedirection |
|
| CanonicalizeExpressionRewriter |
|
| CanonicalizeExpressions |
|
| CreatePartialTopN |
|
| DecorrelateInnerUnnestWithGlobalAggregation |
This rule finds correlated UnnestNode in CorrelatedJoinNode's subquery and folds
them into UnnestNode representing LEFT JOIN UNNEST.
|
| DecorrelateLeftUnnestWithGlobalAggregation |
This rule finds correlated UnnestNode in CorrelatedJoinNode's subquery and folds
them into UnnestNode representing LEFT JOIN UNNEST.
|
| DecorrelateUnnest |
This rule decorrelates plans with correlated UnnestNode and optional EnforceSingleRowNode,
optional LimitNode, optional TopNNode and optional projections in the subquery.
|
| DesugarArrayConstructor |
|
| DesugarAtTimeZone |
|
| DesugarCurrentCatalog |
|
| DesugarCurrentPath |
|
| DesugarCurrentSchema |
|
| DesugarCurrentUser |
|
| DesugarLambdaExpression |
|
| DesugarLike |
|
| DesugarTryExpression |
|
| DetermineJoinDistributionType |
|
| DetermineSemiJoinDistributionType |
This rule must run after the distribution type has already been set for delete queries,
since semi joins in delete queries must be replicated.
|
| DetermineTableScanNodePartitioning |
|
| EliminateCrossJoins |
|
| EvaluateEmptyIntersect |
Converts an Intersect node with at least one empty branch to an empty Values node.
|
| EvaluateZeroSample |
Replaces 0% sample node with empty values node.
|
| ExpressionRewriteRuleSet |
|
| ExtractCommonPredicatesExpressionRewriter |
|
| ExtractDereferencesFromFilterAboveScan |
Transforms:
|
| ExtractSpatialJoins |
Applies to broadcast spatial joins, inner and left, expressed via ST_Contains,
ST_Intersects and ST_Distance functions.
|
| ExtractSpatialJoins.ExtractSpatialInnerJoin |
|
| ExtractSpatialJoins.ExtractSpatialLeftJoin |
|
| GatherAndMergeWindows |
|
| GatherAndMergeWindows.MergeAdjacentWindowsOverProjects |
|
| GatherAndMergeWindows.SwapAdjacentWindowsBySpecifications |
|
| ImplementBernoulliSampleAsFilter |
Transforms:
|
| ImplementExceptAll |
Implement EXCEPT ALL using union, window and filter.
|
| ImplementExceptDistinctAsUnion |
Converts EXCEPT DISTINCT queries into UNION ALL..GROUP BY...WHERE
E.g.:
|
| ImplementFilteredAggregations |
Implements filtered aggregations by transforming plans of the following shape:
|
| ImplementIntersectAll |
Implement INTERSECT ALL using union, window and filter.
|
| ImplementIntersectDistinctAsUnion |
Converts INTERSECT DISTINCT queries into UNION ALL..GROUP BY...WHERE
E.g.:
|
| ImplementLimitWithTies |
Transforms:
|
| ImplementOffset |
Transforms:
|
| InlineProjectIntoFilter |
Replace filter predicate conjuncts with underlying project expressions.
|
| InlineProjections |
Inlines 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).
|
| LambdaCaptureDesugaringRewriter |
|
| MergeExcept |
|
| MergeFilters |
|
| MergeIntersect |
Transforms:
|
| MergeLimitOverProjectWithSort |
Transforms:
|
| MergeLimits |
This rule handles both LimitNode with ties and LimitNode without ties.
|
| MergeLimitWithDistinct |
|
| MergeLimitWithSort |
|
| MergeLimitWithTopN |
This rule handles both LimitNode with ties and LimitNode without ties.
|
| MergePatternRecognitionNodes |
|
| MergePatternRecognitionNodes.MergePatternRecognitionNodesWithoutProject |
|
| MergePatternRecognitionNodes.MergePatternRecognitionNodesWithProject |
|
| MergeProjectWithValues |
Transforms:
|
| MergeUnion |
Transforms:
|
| MultipleDistinctAggregationToMarkDistinct |
Implements distinct aggregations with different inputs by transforming plans of the following shape:
|
| OptimizeDuplicateInsensitiveJoins |
For empty aggregations duplicate input rows can be skipped.
|
| OptimizeRowPattern |
|
| PlanNodeWithCost |
|
| ProjectOffPushDownRule<N extends PlanNode> |
|
| PruneAggregationColumns |
|
| PruneAggregationSourceColumns |
|
| PruneApplyColumns |
This rule restricts the outputs of ApplyNode's input and subquery
based on which ApplyNode's output symbols are referenced.
|
| PruneApplyCorrelation |
This rule updates ApplyNode's correlation list.
|
| PruneApplySourceColumns |
This rule restricts outputs of ApplyNode's subquery to include only the symbols
needed for subqueryAssignments.
|
| PruneAssignUniqueIdColumns |
|
| PruneCorrelatedJoinColumns |
This rule restricts the outputs of CorrelatedJoinNode's input and subquery
based on which CorrelatedJoinNode's output symbols are referenced.
|
| PruneCorrelatedJoinCorrelation |
This rule updates CorrelatedJoinNode's correlation list.
|
| PruneCountAggregationOverScalar |
A count over a subquery can be reduced to a VALUES(1) provided
the subquery is a scalar
|
| PruneDeleteSourceColumns |
|
| PruneDistinctAggregation |
|
| PruneDistinctLimitSourceColumns |
|
| PruneEnforceSingleRowColumns |
|
| PruneExceptSourceColumns |
|
| PruneExchangeColumns |
This 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.
|
| PruneExchangeSourceColumns |
|
| PruneExplainAnalyzeSourceColumns |
|
| PruneFilterColumns |
|
| PruneGroupIdColumns |
This rule prunes GroupIdNode's aggregationArguments.
|
| PruneGroupIdSourceColumns |
|
| PruneIndexJoinColumns |
|
| PruneIndexSourceColumns |
|
| PruneIntersectSourceColumns |
|
| PruneJoinChildrenColumns |
Joins support output symbol selection, so make any project-off of child columns explicit in project nodes.
|
| PruneJoinColumns |
Joins support output symbol selection, so absorb any project-off into the node.
|
| PruneLimitColumns |
|
| PruneMarkDistinctColumns |
|
| PruneOffsetColumns |
|
| PruneOrderByInAggregation |
|
| PruneOutputSourceColumns |
|
| PrunePattenRecognitionColumns |
|
| PrunePatternRecognitionSourceColumns |
This rule restricts the inputs to PatternRecognitionNode
based on which symbols are used by the inner structures
of the PatternRecognitionNode.
|
| PruneProjectColumns |
|
| PruneRowNumberColumns |
|
| PruneSampleColumns |
|
| PruneSemiJoinColumns |
|
| PruneSemiJoinFilteringSourceColumns |
|
| PruneSortColumns |
|
| PruneSpatialJoinChildrenColumns |
|
| PruneSpatialJoinColumns |
Spatial joins support output symbol selection, so absorb any project-off into the node.
|
| PruneTableExecuteSourceColumns |
|
| PruneTableScanColumns |
This is a special case of PushProjectionIntoTableScan that performs only column pruning.
|
| PruneTableWriterSourceColumns |
|
| PruneTopNColumns |
|
| PruneTopNRankingColumns |
|
| PruneUnionColumns |
Transforms
|
| PruneUnionSourceColumns |
|
| PruneUnnestColumns |
Absorb pruning projection into the node.
|
| PruneUnnestSourceColumns |
|
| PruneUpdateSourceColumns |
|
| PruneValuesColumns |
|
| PruneWindowColumns |
|
| PushAggregationIntoTableScan |
|
| PushAggregationThroughOuterJoin |
This 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.
|
| PushCastIntoRow |
Transforms expressions of the form
|
| PushDeleteIntoConnector |
|
| PushDistinctLimitIntoTableScan |
|
| PushDownDereferencesThroughAssignUniqueId |
Transforms:
|
| PushDownDereferencesThroughLimit |
Transforms:
|
| PushDownDereferencesThroughMarkDistinct |
Transforms:
|
| PushDownDereferencesThroughRowNumber |
Transforms:
|
| PushDownDereferencesThroughSort |
Transforms:
|
| PushDownDereferencesThroughTopN |
Transforms:
|
| PushDownDereferencesThroughTopNRanking |
Transforms:
|
| PushDownDereferencesThroughWindow |
Transforms:
|
| PushDownDereferenceThroughFilter |
Transforms:
|
| PushDownDereferenceThroughJoin |
Transforms:
|
| PushDownDereferenceThroughProject |
Transforms:
|
| PushDownDereferenceThroughSemiJoin |
Transforms:
|
| PushDownDereferenceThroughUnnest |
Transforms:
|
| PushdownFilterIntoRowNumber |
|
| PushdownFilterIntoWindow |
|
| PushdownLimitIntoRowNumber |
|
| PushdownLimitIntoWindow |
|
| PushDownNegationsExpressionRewriter |
|
| PushDownProjectionsFromPatternRecognition |
Aggregate functions in pattern recognition context have special semantics.
|
| PushJoinIntoTableScan |
|
| PushLimitIntoTableScan |
|
| PushLimitThroughMarkDistinct |
|
| PushLimitThroughOffset |
Transforms:
|
| PushLimitThroughOuterJoin |
Transforms:
|
| PushLimitThroughProject |
|
| PushLimitThroughSemiJoin |
|
| PushLimitThroughUnion |
Transforms:
|
| PushOffsetThroughProject |
Transforms:
|
| PushPartialAggregationThroughExchange |
|
| PushPartialAggregationThroughJoin |
|
| PushPredicateIntoTableScan |
These rules should not be run after AddExchanges so as not to overwrite the TableLayout
chosen by AddExchanges
|
| PushPredicateThroughProjectIntoRowNumber |
This rule pushes filter predicate concerning row number symbol into RowNumberNode
by modifying maxRowCountPerPartition.
|
| PushPredicateThroughProjectIntoWindow |
This rule pushes filter predicate concerning a ranking symbol into WindowNode
by converting it into TopNRankingNode.
|
| PushProjectionIntoTableScan |
|
| PushProjectionThroughExchange |
Transforms:
|
| PushProjectionThroughJoin |
Utility class for pushing projections through inner join so that joins are not separated
by a project node and can participate in cross join elimination or join reordering.
|
| PushProjectionThroughUnion |
|
| PushRemoteExchangeThroughAssignUniqueId |
Pushes RemoteExchange node down through the AssignUniqueId to preserve
partitioned_on(unique) and grouped(unique) properties for the output of
the AssignUniqueId.
|
| PushSampleIntoTableScan |
|
| PushTableWriteThroughUnion |
|
| PushTopNIntoTableScan |
|
| PushTopNThroughOuterJoin |
Transforms:
|
| PushTopNThroughProject |
Transforms:
|
| PushTopNThroughUnion |
|
| RemoveAggregationInSemiJoin |
Remove the aggregation node that produces distinct rows from the Filtering source of a Semi join.
|
| RemoveDuplicateConditions |
Flattens and removes duplicate conjuncts or disjuncts.
|
| RemoveEmptyDeleteRuleSet |
If the predicate for a delete is optimized to false, the target table scan
of the delete will be replaced with an empty values node.
|
| RemoveEmptyExceptBranches |
Removes branches from an ExceptNode that are guaranteed to produce 0 rows.
|
| RemoveEmptyTableExecute |
If 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.
|
| RemoveEmptyUnionBranches |
Removes branches from a UnionNode that are guaranteed to produce 0 rows.
|
| RemoveFullSample |
Removes 100% sample nodes.
|
| RemoveRedundantDistinctLimit |
Replace DistinctLimit node
1.
|
| RemoveRedundantEnforceSingleRowNode |
|
| RemoveRedundantExists |
Given:
|
| RemoveRedundantIdentityProjections |
Removes projection nodes that only perform non-renaming identity projections
|
| RemoveRedundantJoin |
|
| RemoveRedundantLimit |
Remove 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.
|
| RemoveRedundantOffset |
Remove 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.
|
| RemoveRedundantSort |
|
| RemoveRedundantSortBelowLimitWithTies |
This rule removes SortNode being a source of LimitNode with ties.
|
| RemoveRedundantTableScanPredicate |
|
| RemoveRedundantTopN |
Replace TopN node
1.
|
| RemoveTrivialFilters |
|
| RemoveUnreferencedScalarApplyNodes |
|
| RemoveUnreferencedScalarSubqueries |
|
| RemoveUnsupportedDynamicFilters |
Dynamic filters are supported only right after TableScan and only if the subtree is on
1.
|
| ReorderJoins |
|
| ReplaceJoinOverConstantWithProject |
This rule transforms plans with join where one of the sources is
a single-row ValuesNode, and the join condition is `on true`.
|
| ReplaceRedundantJoinWithProject |
This rule is complementary to RemoveRedundantJoin.
|
| ReplaceRedundantJoinWithSource |
This rule transforms plans with joins, where:
- one of the sources is scalar and produces no output symbols.
|
| ReplaceWindowWithRowNumber |
|
| RewriteSpatialPartitioningAggregation |
Re-writes spatial_partitioning(geometry) aggregations into spatial_partitioning(envelope, partition_count)
on top of ST_Envelope(geometry) projection, e.g.
|
| Rules |
|
| SetOperationNodeTranslator |
|
| SetOperationNodeTranslator.TranslationResult |
|
| SimplifyCountOverConstant |
|
| SimplifyExpressions |
|
| SimplifyFilterPredicate |
Simplify conditional expressions in filter predicate.
|
| SingleDistinctAggregationToGroupBy |
Implements distinct aggregations with similar inputs by transforming plans of the following shape:
|
| TransformCorrelatedDistinctAggregationWithoutProjection |
This 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 subquery
|
| TransformCorrelatedDistinctAggregationWithProjection |
This rule decorrelates a correlated subquery of LEFT correlated join with distinct operator (grouped aggregation with no aggregation assignments)
|
| TransformCorrelatedGlobalAggregationWithoutProjection |
This rule decorrelates a correlated subquery with:
- single global aggregation, or
- global aggregation over distinct operator (grouped aggregation with no aggregation assignments)
It is similar to TransformCorrelatedGlobalAggregationWithProjection rule, but does not support projection over aggregation in the subquery
|
| TransformCorrelatedGlobalAggregationWithProjection |
This 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)
|
| TransformCorrelatedGroupedAggregationWithoutProjection |
This 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)
It is similar to TransformCorrelatedGroupedAggregationWithProjection rule, but does not support projection over aggregation in the subquery
|
| TransformCorrelatedGroupedAggregationWithProjection |
This 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)
|
| TransformCorrelatedInPredicateToJoin |
Replaces correlated ApplyNode with InPredicate expression with SemiJoin
|
| TransformCorrelatedJoinToJoin |
Tries to decorrelate subquery and rewrite it using normal join.
|
| TransformCorrelatedScalarSubquery |
Scalar filter scan query is something like:
|
| TransformCorrelatedSingleRowSubqueryToProject |
This optimizer can rewrite correlated single row subquery to projection in a way described here:
From:
|
| TransformExistsApplyToCorrelatedJoin |
EXISTS is modeled as (if correlated predicates are equality comparisons):
|
| TransformFilteringSemiJoinToInnerJoin |
Rewrite filtering semi-join to inner join.
|
| TransformUncorrelatedInPredicateSubqueryToSemiJoin |
This optimizers looks for InPredicate expressions in ApplyNodes and replaces the nodes with SemiJoin nodes.
|
| TransformUncorrelatedSubqueryToJoin |
|
| UnwrapCastInComparison |
Given s of type S, a constant expression t of type T, and when an implicit
cast exists between S->T, converts expression of the form:
|
| UnwrapRowSubscript |
Transforms expressions of the form
ROW(x, y)[1] to x
and
CAST(ROW(x, y) AS row(f1 type1, f2 type2))[1] to CAST(x AS type1)
|
| UnwrapSingleColumnRowInApply |
Given x::row(t) and y::row(t), converts assignments of the form
|