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.
rowexec: paired joiners to accomplish left joins
The paired joiners are used to accomplish left {outer,semi,anti} joins when the first joiner will produce false positives (as known to the optimizer). Currently, only the invertedJoiner can function as this first joiner but there is wording in the spec describing how this could also be useful for join expressions that can't be fully evaluated on one non-inverted index. The first joiner outputs an additional bool column representing a continuation value. This is used to demarcate groups of consecutive rows output by the first joiner that represent the same original left row. The first joiner needs to preserve input row order (the invertedJoiner always does this). The second joiner is a lookup join and handles these groups in a special manner. The second join does not need to be order preserving. Informs cockroachdb#53576 Prior to this, the way to do: - a left outer join with an inverted join is to do an inner join with the same ON condition, which is a pair of inverted join and lookup join, and then wrap the expression in another left join with the original left side. - a left anti join with an inverted join is to map it to a left outer join (previous bullet). - a left semi join is to map it to an inner join with the same ON condition, which is a pair of inverted join and lookup join, and then project, sort (or make the lookup join order preserving) and dedup. We expect that the alternative outlined in this PR (it excludes the optimizer changes) will be more efficient since it is simply a pairing of inverted joiner and lookup join (and the latter does not need to be order preserving). Release note: None
- Loading branch information
1 parent
00a95b8
commit cbdadf2
Showing
8 changed files
with
1,055 additions
and
389 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
Large diffs are not rendered by default.
Oops, something went wrong.
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.