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.
131383: opt: fix greedy lookup join constraints r=mgartner a=mgartner #### opt: lazily convert lookup join equality columns to lookup expr Previously, the lookup join constraint builder would immediately convert equality columns to an equality expression in the lookup expression when it was determined that a lookup expression was required to perform the lookup join. Now, this conversion happens after all the equality columns and the lookup expression have been collected. This simplifies the logic. Release note: None #### opt: fix greedy lookup join constraints Previously, lookup joins would be planned that constrained as many index columns as possible. This is not optimal when a suffix of columns are constrained to multiple values or a range of constant values by optional filters. These suffixes increase the number of lookup spans without making the constraint more selective. In the case where suffix columns are constrained to multiple values, a lookup span is generated for each value, significantly increasing the number of lookups performed for each input row. This commit makes the building of lookup join constraints less greedy. The suffix of constrained columns will only be constrained to multiple values or a range over some constant values if those constraints originate from the query filter. Fixes cockroachdb#75596 Release note (performance improvement): The optimizer now plans more efficient lookup joins in some cases. Co-authored-by: Marcus Gartner <[email protected]>
- Loading branch information
Showing
16 changed files
with
355 additions
and
231 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
Oops, something went wrong.