-
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](mtmv) Support to add use_for_rewrite property when create materialized view #40332
[improvement](mtmv) Support to add use_for_rewrite property when create materialized view #40332
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
1 similar comment
run buildall |
TPC-H: Total hot run time: 37811 ms
|
TPC-DS: Total hot run time: 192352 ms
|
ClickBench: Total hot run time: 32.11 s
|
is_used_in_rewrite -> use_for_rewrite |
run buildall |
TPC-H: Total hot run time: 38457 ms
|
TPC-DS: Total hot run time: 192909 ms
|
ClickBench: Total hot run time: 32.72 s
|
LOG.debug(String.format("mv doesn't part in query rewrite process because " | ||
+ "use_for_rewrite is false, mv is %s", | ||
materializedView.getName())); |
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.
avoid use string format, use '{}' in message template to avoid new string object for every log even if not print it
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.
Have fixed it
44f9817
to
7e5124b
Compare
run buildall |
TPC-H: Total hot run time: 38082 ms
|
TPC-DS: Total hot run time: 190022 ms
|
ClickBench: Total hot run time: 31.64 s
|
.../main/java/org/apache/doris/nereids/rules/exploration/mv/InitMaterializationContextHook.java
Outdated
Show resolved
Hide resolved
PR approved by anyone and no changes requested. |
run buildall |
TPC-H: Total hot run time: 37715 ms
|
TPC-DS: Total hot run time: 192962 ms
|
ClickBench: Total hot run time: 31.45 s
|
run buildall |
TPC-H: Total hot run time: 37958 ms
|
TPC-DS: Total hot run time: 192217 ms
|
ClickBench: Total hot run time: 31.65 s
|
run buildall |
TPC-H: Total hot run time: 38201 ms
|
TPC-DS: Total hot run time: 198913 ms
|
ClickBench: Total hot run time: 32.07 s
|
PR approved by at least one committer and no changes requested. |
…te materialized view (apache#40332) Add `is_used_in_rewrite` property when create mv. Default true; If `is_used_in_rewrite` is false which means the mv would not partion in query rewrite. Such as mv def is as following: CREATE MATERIALIZED VIEW mv1 BUILD IMMEDIATE REFRESH AUTO ON MANUAL DISTRIBUTED BY RANDOM BUCKETS 2 PROPERTIES ( 'replication_num' = '1', 'use_for_rewrite' = 'false' ) AS SELECT k1, k2, count(*) from t1 group by k1, k2; if we run query as following, this mv would not partition in the query rewrite: SELECT k2, count(*) from t1 group by k2;
…te materialized view (#40332) Add `is_used_in_rewrite` property when create mv. Default true; If `is_used_in_rewrite` is false which means the mv would not partion in query rewrite. Such as mv def is as following: CREATE MATERIALIZED VIEW mv1 BUILD IMMEDIATE REFRESH AUTO ON MANUAL DISTRIBUTED BY RANDOM BUCKETS 2 PROPERTIES ( 'replication_num' = '1', 'use_for_rewrite' = 'false' ) AS SELECT k1, k2, count(*) from t1 group by k1, k2; if we run query as following, this mv would not partition in the query rewrite: SELECT k2, count(*) from t1 group by k2;
Proposed changes
Add
use_for_rewrite
property when create mv. Default true;If
use_for_rewrite
is false which means the mv would not partion in query rewrite.Such as mv def is as following:
if we run query as following, this mv would not partition in the query rewrite: