forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
87790: norm: early inlining of WITH bound expression with VALUES r=mgartner,rytaft,DrewKimball,cucaroach a=msirek Fixes https://github.com/cockroachlabs/support/issues/1769 This commit implements early inlining of WITH clause bound expressions (at the time when the WithScanExpr is normalized) if the WITH bound expression is a ValuesExpr with all constant expressions or placeholders and it appears in an IN or NOT IN expression, for example: `column IN (VALUES(...))` or `column NOT IN(VALUES(...))`. Not doing early inlining can result in a superfluous join. Normally WITH clause inlining is done when the top-level WithExpr is normalized, but since normalization is done bottom-up, the WithExpr is processed last, making the inlining too late to trigger other normalization rules. Release note (performance improvement): This patch adds early inlining of VALUES clauses and unnested arrays in WITH queries in order to eliminate unnecessary joins. Co-authored-by: Mark Sirek <[email protected]>
- Loading branch information
Showing
7 changed files
with
326 additions
and
12 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