-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[opt](nereids) support extract join multiple tables #51569
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
[opt](nereids) support extract join multiple tables #51569
Conversation
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
run buildall |
TPC-H: Total hot run time: 33629 ms
|
TPC-DS: Total hot run time: 193441 ms
|
ClickBench: Total hot run time: 28.55 s
|
I'd like to ask a question. For a single table performing an expression extraction, it's possible to push down the operations layer by layer through joins. However, in the case of multiple tables performing expression extraction, it targets the left and right children of the join. If these left and right children also qualify for expression extraction (whether single-table or multi-table), is this currently supported? |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
What problem does this PR solve?
For rule ExtractSingleTableExpressionFromDisjunction, it will extract every single table's expression for LogicalFilter and LogicalJoin. But this is not enough, for join, it should support extract multiple tables: a expression for left tables, and a right expression for right tables.
For example:
it can't extract each single table expression for t1, t2, t3, t4.
but for the root join, its left plan is
(t1 join t2)
, we can extract left plan's expressiont1.a + t2.a = 1 or t1.a + t2.a = 2
.also for the right plan
(t3 join t4)
, we can extract right plan's expressiont3.x + t4.x = 1 or t3.x + t4.x = 2
.Then we can rewrite the root join's conditition as
latter, we can push down left plan expression to the left plan expression, and right plan expression to the right plan expression.
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)