-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
117499: opt: add rule to merge GroupBy and Window operators r=DrewKimball a=DrewKimball #### opt: add method to add strict dependency to FuncDepSet This commit adds a new method, `AddStrictDependency`, to `FuncDepSet`. This will be used in the following commit to add a dependency between a Window operator's partition columns and its functions. Existing methods don't work for this because the dependency is not a key. Epic: None Release note: None #### opt: infer functional dependencies for window functions This commit adds logic to infer strict functional dependencies from a Window operator's partition column(s) to some or all of its window functions when the following conditions are satisfied: 1. The window function must be an aggregate, or first_value or last_value. 2. The window frame must be unbounded. The above conditions ensure that the window function always produces the same result given the same window frame, as well as that every row in a partition has the same window frame. This means that the window function produces the same output for every row in the partition, and therefore, the partition columns functionally determine the output of the window function. Epic: None Release note: None #### opt: add rule to merge GroupBy and Window This commit adds a new norm rule, `FoldGroupByAndWindow`, which can merge a Window operator with a parent GroupBy operator when the grouping columns are the same as the partition columns. See the rule comment for the complete list of conditions. In addition to removing a potentially expensive Window operator, this transformation makes way for other rules to match. Fixes #113292 Release note: None 137069: opt: add implicit SELECT FOR UPDATE to initial scan of DELETE r=yuzefovich a=yuzefovich This commit makes it so that we apply implicit SELECT FOR UPDATE locking behavior to the initial scan of the DELETE operation in some cases. Namely, we do so when the input to the DELETE is either a scan or an index join on top of a scan (with any number of renders on top) - these conditions mean that all filters were pushed down into the scan, so we won't lock any unnecessary rows. I think it's only possible to have at most one render expression on top of the scan, but I chose to be defensive and allowed nested renders too. In such form the conditions are exactly the same as we use for adding SFU to UPDATEs, so the same function is reused. Existing `enable_implicit_select_for_update` session variable is consulted. Fixes: #50181. Release note (sql change): DELETE statements now acquire locks using the FOR UPDATE locking mode during their initial row scan in some comes, which improves performance for contended workloads. This behavior is configurable using the `enable_implicit_select_for_update` session variable. Co-authored-by: Drew Kimball <[email protected]> Co-authored-by: Yahor Yuzefovich <[email protected]>
- Loading branch information
Showing
41 changed files
with
1,326 additions
and
202 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Oops, something went wrong.