Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
query_graph: Classify join preds for LEFT JOINs
Unlike inner joins, non-join-key predicates in left joins can't just be considered as part of other query predicates in the WHERE clause - semantically, those predicates need to be executed either above the join, or as part of the join itself - specifically so that rows which *don't* satisfy those predicates get NULLs for all columns from the right-hand side of the join. In the real world, many queries have "local" predicates in the ON clause of the join - predicates which mention only columns on one side of the join. These predicates can be compiled as regular filter nodes just above the join on either side, without having to modify the left join operator in dataflow to execute arbitrary filter expressions during join clause evaluation. To pave the way to compiling these queries, this commit classifies the (non join-predicate) conditions in the ON clause of LEFT JOINs as either local to the left, local to the right, global, or parameters. This still returns an error whenever these lists are non-empty, but coming up we can compile left-local and right-local preds as filter nodes during MIR lowering. Change-Id: I55f91a8172b1611fb636470a0f365942901c4e05 Reviewed-on: https://gerrit.readyset.name/c/readyset/+/6224 Tested-by: Buildkite CI Reviewed-by: Luke Osborne <luke@readyset.io>
- Loading branch information
1 parent
b254e94
commit 9fa3923
Showing
3 changed files
with
103 additions
and
7 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