-
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.
In an expression like `a IN (VALUES (a11, a12), (b11, b12), ...)`, the Values clause is a subquery, but since it has fixed results we can just inline the values directly: `a IN ((a11, a12), (b11, b12), ...)`. This leads to better plans, e.g we can constrain scans to these values. The two forms are equivalent, even if the expressions have side-effects. Release note (performance improvement): better execution plans when a `VALUES` clause is used as the right-hand side of `IN` or `ANY`.
- Loading branch information
1 parent
a699f1d
commit fa941da
Showing
4 changed files
with
199 additions
and
40 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