-
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.
xform: ignore derived hash bucket lookup join cols for selectivity es…
…timate Fixes #85353 Previously, a lookup join involving the first column of a hash-sharded index and a column from another table would use a derived equality condition between the invisible hash bucket column and an expression on the other table's column for selectivity estimation purposes. Since the derived join condition does not actually reduce the number of qualified rows, the optimizer would end up with an underestimated row count estimate for the join, and end up selecting it, when lower cost join methods existed. To address this, this patch remembers which left table key columns in the lookup join are synthesized for derived equijoin conditions on the lookup table hash bucket column, and ignores them when building the filter functional dependencies which are later used in `selectivityFromEquivalencies()` for calculating the join selectivity. Release justification: Low risk fix for costly lookup joins on hash-sharded indexes. Release note (bug fix): This patch fixes a bug in lookup join selectivity estimation involving hash-sharded indexes which may cause lookup joins to be selected by the optimizer in cases where other join methods are less expensive.
- Loading branch information
Mark Sirek
committed
Aug 29, 2022
1 parent
8fc4fc1
commit 4807844
Showing
9 changed files
with
282 additions
and
88 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
Oops, something went wrong.