-
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.
62406: opt: produce constant columns in predicate from partial index scan r=mgartner a=mgartner #### opt: refactor indexScanBuilder This commit refactors `indexScanBuilder` to make it safer to use and maintain. - Functions that are intended for use outside of the struct's implementation have been capitalized to make this more apparent. - Helper functions that determine the state of the builder have been added to simplify the internal logic of the builder. - `primaryKeyCols` was removed because it is unrelated to building scans. Release note: None #### opt: produce constant columns in predicate from partial index scan `GenerateConstrainedScans` and `GeneratePartialIndexScans` now build Project expressions to produce columns that are held constant in partial index predicates when possible. This allows a partial index to cover columns and avoid IndexJoins in more cases. A column held constant in a partial index predicate is only projected when: 1. The index does not include the column. 2. All columns can be covered because they are either in the index or held constant by the predicate. In other words, a Project is only built when doing so eliminates an IndexJoin. Resolves #60532 Release note (performance improvement): Columns that are held constant in partial index predicates can now be produced when scanning the partial index. This eliminates unnecessary primary index joins to retrieve those constant columns in some queries, resulting in lower latency. Co-authored-by: Marcus Gartner <[email protected]>
- Loading branch information
Showing
10 changed files
with
874 additions
and
382 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
Oops, something went wrong.