-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[Improvement](nereids) Support join derivation when mv rewrite #29609
[Improvement](nereids) Support join derivation when mv rewrite #29609
Conversation
bdcf648
to
5fe7e10
Compare
run buildall |
TPC-H: Total hot run time: 38601 ms
|
TPC-DS: Total hot run time: 184660 ms
|
(From new machine)TeamCity pipeline, clickbench performance test result: |
run buildall |
(From new machine)TeamCity pipeline, clickbench performance test result: |
TPC-H: Total hot run time: 38382 ms
|
TPC-DS: Total hot run time: 184043 ms
|
return SplitPredicate.empty(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is empty splitPredicate meaning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe an invalid instance is better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this means invalid, i will change it more semantic
comparisonResult); | ||
// if the join type in query and mv plan is different, we should check and add filter on mv to make | ||
// the mv join type is accord with query | ||
Set<Set<Slot>> viewNoNullableSlot = comparisonResult.getViewNoNullableSlot(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe requireNoNullableSlot
name is better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, it's better
if (viewNoNullableSlot.stream().anyMatch( | ||
set -> Sets.intersection(set, queryUsedRejectNullSlotsViewBased).isEmpty())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be allMatch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty splitPredicate is invalid, so this should be anymatch
@@ -39,4 +43,9 @@ public FunctionSignature customSignature() { | |||
return FunctionSignature.ret(dataType).args(dataType); | |||
} | |||
|
|||
@Override | |||
public Expression withChildren(List<Expression> children) { | |||
Preconditions.checkArgument(children.size() == 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add check msg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
@@ -39,4 +43,9 @@ public FunctionSignature customSignature() { | |||
return FunctionSignature.ret(dataType).args(dataType); | |||
} | |||
|
|||
@Override | |||
public Expression withChildren(List<Expression> children) { | |||
Preconditions.checkArgument(children.size() == 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add check msg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I will fix it
199a7ce
to
10c402c
Compare
run buildall |
TPC-H: Total hot run time: 38887 ms
|
TPC-DS: Total hot run time: 184691 ms
|
PR approved by anyone and no changes requested. |
(From new machine)TeamCity pipeline, clickbench performance test result: |
PR approved by at least one committer and no changes requested. |
1fcbc71
to
7119dc1
Compare
run buildall |
TPC-H: Total hot run time: 38539 ms
|
TPC-DS: Total hot run time: 184953 ms
|
(From new machine)TeamCity pipeline, clickbench performance test result: |
PR approved by at least one committer and no changes requested. |
materialized view def is as following: > select l_linenumber, o_custkey > from orders > left join lineitem on lineitem.L_ORDERKEY = orders.O_ORDERKEY > where o_custkey = 1; when query is as following, it can be rewritten by mv above it requires that query has reject null filters on the join right input, current supported filter are "=", "<", "<=", ">", ">=", "<=>" > select IFNULL(orders.O_CUSTKEY, 0) as custkey_not_null, > case when l_linenumber in (1,2,3) then l_linenumber else o_custkey end as case_when > from orders > inner join lineitem on orders.O_ORDERKEY = lineitem.L_ORDERKEY > where o_custkey = 1 and l_linenumber > 0;
…e#29609) materialized view def is as following: > select l_linenumber, o_custkey > from orders > left join lineitem on lineitem.L_ORDERKEY = orders.O_ORDERKEY > where o_custkey = 1; when query is as following, it can be rewritten by mv above it requires that query has reject null filters on the join right input, current supported filter are "=", "<", "<=", ">", ">=", "<=>" > select IFNULL(orders.O_CUSTKEY, 0) as custkey_not_null, > case when l_linenumber in (1,2,3) then l_linenumber else o_custkey end as case_when > from orders > inner join lineitem on orders.O_ORDERKEY = lineitem.L_ORDERKEY > where o_custkey = 1 and l_linenumber > 0;
…e#29609) materialized view def is as following: > select l_linenumber, o_custkey > from orders > left join lineitem on lineitem.L_ORDERKEY = orders.O_ORDERKEY > where o_custkey = 1; when query is as following, it can be rewritten by mv above it requires that query has reject null filters on the join right input, current supported filter are "=", "<", "<=", ">", ">=", "<=>" > select IFNULL(orders.O_CUSTKEY, 0) as custkey_not_null, > case when l_linenumber in (1,2,3) then l_linenumber else o_custkey end as case_when > from orders > inner join lineitem on orders.O_ORDERKEY = lineitem.L_ORDERKEY > where o_custkey = 1 and l_linenumber > 0;
Proposed changes
materialized view def is as following:
when query is as following, it can be rewritten by mv above
it requires that query has reject null filters on the join right input,
current supported filter are "=", "<", "<=", ">", ">=", "<=>"
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...