Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rowexec: paired joiners to accomplish left joins #54639

Merged
merged 1 commit into from
Sep 29, 2020

Commits on Sep 29, 2020

  1. 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
    sumeerbhola committed Sep 29, 2020
    Configuration menu
    Copy the full SHA
    74f83be View commit details
    Browse the repository at this point in the history