go-mysql-server icon indicating copy to clipboard operation
go-mysql-server copied to clipboard

More join types

Open max-hoffman opened this issue 2 years ago • 0 comments

Add FullOuterJoin, SemiJoin, and AntiJoin.

None of these new join nodes are safe for join ordering transformations yet. They are explicitly excluded from join planning.

The getField indexes for these three nodes' join conditions deserve more consideration. I excluded them from auto-fixup after manually correcting join condition get fields for the appropriate schemas.

FullOuterJoin uses a union distinct execution operator, which is correct but a lot slower than a merge join-esque operator.

SemiJoin and AntiJoin rearrange subquery expression scopes. I separate resolve and finalizeSubqueryExpressions to perform decorrelation before predicate pushdown (where we were panicking on FixUpExpressions) and join ordering (we want to decorrelate scopes before join planning).

Other:

  • query plan tests added for exist hoisting edge cases i did not catch on first pass
  • fixed bug with CTE stars

max-hoffman avatar Sep 22 '22 23:09 max-hoffman