-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve de-correlation of grouped distinct aggregations
A grouped distinct aggregation is planned as two AggregationNodes: one being the "distinct operator", and one doing the actual aggregation. This change improves query performance in the case when two such AggregationNodes are present in a correlated subquery. Before this change, both AggregationNodes were extracted from the subquery, and moved on top of the de-correlated JoinNode. After this change, the "distinct operator" is not moved from the subquery if it can be de-correlated by the PlanNodeDecorrelator. Leaving the "distinct operator" in the subquery unblocks other optimizations, e.g. `PushAggregationThroughOuterJoin`. This change affects the following rules: `TransformCorrelatedGroupedAggregationWithProjection`, `TransformCorrelatedGroupedAggregationWithoutProjection`. A similar change was introduced for global distint aggregations, in rules: `TransformCorrelatedGlobalAggregationWithProjection`. `TransformCorrelatedGlobalAggregationWithoutProjection`.
- Loading branch information
Showing
5 changed files
with
148 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters