-
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: allow lookup joins to order on index columns
It is possible for lookup joins to return the results of each lookup in the order of the lookup index. In the case when the input is ordered on a key, preserving the input ordering and then returning looked-up rows in index order is equivalent to performing a sort on the input ordering with the index columns appended. This patch teaches the optimizer that lookup joins can preserve the index ordering. This allows the optimizer to avoid sorting in some cases, which can significantly improve performance because sorts have to buffer all input rows. Due to implementation details of the lookup join, order can only be preserved when none of the index columns involved in the ordering are sorted in descending order. Fixes #84685 Release note (performance improvement): The optimizer can now return the results of a join in sorted order in more cases. This can allow the optimizer to avoid expensive sorts that need to buffer all input rows.
- Loading branch information
1 parent
cbfceb7
commit fee51ab
Showing
13 changed files
with
924 additions
and
69 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
Oops, something went wrong.