-
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.
opt: improve per-ON condition cost adjustment for lookup join
Issue #34810 tracks taking into account the internal row count of lookup joins. We currently have a hack in place to always prefer looking indexes that constrain more columns. We encountered a case where this adjustment doesn't work: when the estimated row count is very very small (which happens when there are a lot of conditions), the per-row cost adjustment ends up not making a difference (this is because of limited floating point precision, and the "tolerance" built into `Cost.Less()`). To address this, we also add a constant per-ON condition cost which isn't scaled by the row count. Release note (bug fix): Fixed bug in the optimizer causing a bad index for lookup join in some cases.
- Loading branch information
1 parent
f808f31
commit cbbf789
Showing
7 changed files
with
184 additions
and
81 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
Oops, something went wrong.