-
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.
60553: opt: inline all filters with virtual columns r=mgartner a=mgartner #### opt: inline all filters with virtual columns Previously, `InlineSelectVirtualColumns` inlined virtual column expressions in filters and pushed those filters below a Project only if the virtual columns were indexed. Now, all virtual column expressions are inlined. This allows exploration rules to generate expressions that utilize partial indexes with predicates that reference virtual columns. We considered extending `InlineSelectVirtualColumns` to also inline a virtual columns if they are referenced in partial index predicates. This would require addition metadata to keep track of the set of such virtual columns. Virtual columns have already been inlined in the predicates in the table metadata, so simply fetching the outer columns of those predicates would not suffice. Because this rule already is highly selective (only operating on virtual columns), we opted to simplify the rule to inline all virtual columns instead. There is no release note because virtual columns are gated behind an experimental session setting. Release note: None #### opt: fix optsteps panic from InlineSelectVirtualColumns Previously, running the `optsteps` test command panicked with "could not find path to expr" for queries when `InlineSelectVirtualColumns` was matched. This commit fixes the panic by eliminating the anti-pattern of calling a constructor during the pattern-match phase of a normalization rule. The `optsteps` test command displays step `n` of optimization by running the optimizer twice and halting after `n` and `n - 1` rules have been applied. The difference in the two resulting expressions represents the change in step `n`. `InlineSelectVirtualColumns` previously called `ConstructFiltersItem` during the pattern-match phase of the rule, but only added the constructed filters item to the memo in the replace phase of the rule. When some normalization rule applied during the call to `ConstructFiltersItem` was the last rule applied in a step, the constructed item was not added to the memo because the limit on the number of rules prevented the replace phase of `InlineSelectVirtualColumns`. As a result, `optsteps` panicked when it could not find the normalized `FiltersItem` in the memo. Release note: None 60624: tree: correctly redact value of into_db r=dt a=dt Release note (bug fix): fix a bug that would cause the value of the optional into_db parameter to RESTORE to be included in anonymizeds crash reports. Co-authored-by: Marcus Gartner <[email protected]> Co-authored-by: David Taylor <[email protected]>
- Loading branch information
Showing
7 changed files
with
180 additions
and
325 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.