Skip to content

Conversation

@seawinde
Copy link
Contributor

Proposed changes

pr: #40485
commitId: 18a374f

pr: #40332
commitId: cd2062a

pr: #39998
commitId: 948fb2a

seawinde and others added 4 commits September 14, 2024 10:26
…plain (apache#39998)

Optimize the explain materialized view info, add double horizontal
dividing line between `MATERIALIZATIONS` and`STATISTICS`.
Maybe think rewrite fail because` planed with unknown column statistics `,
actually is rewrite successfully.

Before:

| ========== MATERIALIZATIONS ==========                                                                                                                                                                                                                |
|                                                                                                                                                                                                                                                       |
| MaterializedView                                                                                                                                                                                                                                      |
| MaterializedViewRewriteSuccessAndChose:                                                                                                                                                                                                               |
|   internal#regression_test_nereids_rules_p0_mv_agg_with_roll_up#mv13_1 chose,                                                                                                                                                                         |
|                                                                                                                                                                                                                                                       |
| MaterializedViewRewriteSuccessButNotChose:                                                                                                                                                                                                            |
|   not chose: none,                                                                                                                                                                                                                                    |
|                                                                                                                                                                                                                                                       |
| MaterializedViewRewriteFail:                                                                                                                                                                                                                          |
|                                                                                                                                                                                                                                                       |
| Statistics                                                                                                                                                                                                                                            |
|  planed with unknown column statistics

After:

| ========== MATERIALIZATIONS ==========                                                                                                                                                                                                                |
|                                                                                                                                                                                                                                                       |
| MaterializedView                                                                                                                                                                                                                                      |
| MaterializedViewRewriteSuccessAndChose:                                                                                                                                                                                                               |
|   internal.regression_test_nereids_rules_p0_mv_agg_with_roll_up.mv13_1 chose,                                                                                                                                                                         |
|                                                                                                                                                                                                                                                       |
| MaterializedViewRewriteSuccessButNotChose:                                                                                                                                                                                                            |
|   not chose: none,                                                                                                                                                                                                                                    |
|                                                                                                                                                                                                                                                       |
| MaterializedViewRewriteFail:                                                                                                                                                                                                                          |
|                                                                                                                                                                                                                                                       |
|                                                                                                                                                                                                                                                       |
| ========== STATISTICS ==========                                                                                                                                                                                                                      |
| planed with unknown column statistics
…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;
…m both side of join (apache#40485)

This is brought by apache#35562
if partition mv def is as following:

        CREATE MATERIALIZED VIEW mv1
        BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL
        PARTITION BY (upgrade_day)
        DISTRIBUTED BY RANDOM BUCKETS 2
        PROPERTIES ('replication_num' = '1')
        AS
       select t1.upgrade_day, t2.batch_no, count(*)
       from test2 t2 join test1 t1 on
       t1.upgrade_day = t2.upgrade_day
       group by t1.upgrade_day, t2.batch_no;

the mv related partition table should `test1`, but now is `test2`, this pr fix this.
@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@seawinde
Copy link
Contributor Author

run buildall

2 similar comments
@seawinde
Copy link
Contributor Author

run buildall

@seawinde
Copy link
Contributor Author

run buildall

@seawinde
Copy link
Contributor Author

run buildall

@yiguolei yiguolei merged commit fe9f4fd into apache:branch-2.1 Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants