-
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.
43405: opt: fix optsteps crash caused by constraint expressions r=RaduBerinde a=RaduBerinde #### opt: make FormatExpr easier to use During debugging, it's sometimes useful to add a statement to print an expression. This is fairly hard and can crash easily because the memo or the catalog isn't set in the formatting context. In particular, it is impossible to print a scalar expression that contains a relational expression because `FormatExpr` only sets the memo when we print relational expressions. This change improves the situation by allowing the caller of `FormatExpr` to pass the `*Memo` and by adding a convenience wrapper method on the `Optimizer`. We also automatically unset the "fully qualify" flag if there is no catalog (which would otherwise crash). Release note: None #### opt: fix optsteps crash caused by TableMeta expressions The optbuilder creates scalar constraint and computed column expressions and hangs them off the `TableMeta`. If a normalization rule fires for one of these expressions, `optsteps` panics because it can't find a path to the expression in the memo. This change fixes the problem by adding special code in opt_steps which effectively treats these expressions as children of Scan expressions. Release note: None #### opt: show TableMeta expressions when formatting expressions We build check constraint and computed column expressions and attach them to `TableMeta`, to be used later by exploration rules. These are currently invisible. This change adds them under "canonical" scans (the normalized scan expression before any exploration rules). Release note: None 43424: reducesql: also attempt to remove columns from PKs r=mjibson a=mjibson Release note: None Co-authored-by: Radu Berinde <[email protected]> Co-authored-by: Matt Jibson <[email protected]>
- Loading branch information
Showing
22 changed files
with
1,277 additions
and
92 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
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.