foxtail463 commented on PR #64036:
URL: https://github.com/apache/doris/pull/64036#issuecomment-4604240656

   <h2 data-line="0" class="code-line" dir="auto" id="performance-evaluation" 
style="margin-top: 24px; font-weight: 600; margin-bottom: 16px; line-height: 
1.25; font-size: 1.5em; padding-bottom: 0.3em; border-bottom-width: 1px; 
border-bottom-style: solid; position: relative; color: rgb(255, 255, 255); 
font-family: -apple-system, &quot;system-ui&quot;, &quot;Segoe WPC&quot;, 
&quot;Segoe UI&quot;, system-ui, Ubuntu, &quot;Droid Sans&quot;, sans-serif; 
font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; 
letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; 
text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 
0px; white-space: normal; text-decoration-thickness: initial; 
text-decoration-style: initial; text-decoration-color: initial;">Performance 
Evaluation</h2><p data-line="2" class="code-line" dir="auto" style="margin-top: 
0px; margin-bottom: 16px; position: relative; color: rgb(255, 255, 255); 
font-family: -apple-s
 ystem, &quot;system-ui&quot;, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, 
system-ui, Ubuntu, &quot;Droid Sans&quot;, sans-serif; font-size: 14px; 
font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; 
font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; 
text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; 
-webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: 
initial; text-decoration-style: initial; text-decoration-color: initial;">This 
benchmark checks whether the new StructInfo candidate lookup adds visible MV 
rewrite overhead. It compares the current patch<span> </span><code 
style="font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; color: 
rgb(255, 255, 255); background-color: rgba(0, 0, 0, 0); padding: 1px 3px; 
border-radius: 4px; font-size: 1em; line-height: 
1.357em;">95e91304f729ef6d446973bc0f0d95d923aada51</code><span> 
</span>with<span> </span><code style="font-family: Menlo, Mo
 naco, &quot;Courier New&quot;, monospace; color: rgb(255, 255, 255); 
background-color: rgba(0, 0, 0, 0); padding: 1px 3px; border-radius: 4px; 
font-size: 1em; line-height: 1.357em;">doris/master</code><span> </span><code 
style="font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; color: 
rgb(255, 255, 255); background-color: rgba(0, 0, 0, 0); padding: 1px 3px; 
border-radius: 4px; font-size: 1em; line-height: 
1.357em;">4e81acee0d83e1db3100a0eb8fe820d05c833c31</code>.</p><p data-line="7" 
class="code-line" dir="auto" style="margin-top: 0px; margin-bottom: 16px; 
position: relative; color: rgb(255, 255, 255); font-family: -apple-system, 
&quot;system-ui&quot;, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, system-ui, 
Ubuntu, &quot;Droid Sans&quot;, sans-serif; font-size: 14px; font-style: 
normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 
400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; 
text-transform: none; widows: 2; word
 -spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; 
text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-color: initial;">The benchmark SQL models a nested MV rewrite 
case with base tables, a view, child MVs, and a parent MV. The query starts 
from base tables and a view, while the target MV is defined over child MVs. 
This shape exercises the nested MV rewrite path and the StructInfo candidate 
lookup changed by this PR.</p><p data-line="12" class="code-line" dir="auto" 
style="margin-top: 0px; margin-bottom: 16px; position: relative; color: 
rgb(255, 255, 255); font-family: -apple-system, &quot;system-ui&quot;, 
&quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, system-ui, Ubuntu, &quot;Droid 
Sans&quot;, sans-serif; font-size: 14px; font-style: normal; 
font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; 
letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; 
text-transform: none; widows: 2; word-spacing: 
 0px; -webkit-text-stroke-width: 0px; white-space: normal; 
text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-color: initial;">Example:</p><pre data-line="14" 
class="code-line" dir="auto" style="margin-top: 0px; background-color: rgb(0, 
0, 0); border-color: rgb(111, 195, 223); border-style: solid; border-width: 
1px; border-image: none 100% / 1 / 0 stretch; padding: 16px; border-radius: 
3px; overflow: auto; white-space: pre-wrap; position: relative; color: rgb(255, 
255, 255); font-size: 14px; font-style: normal; font-variant-ligatures: normal; 
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 
2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; 
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: 
initial; text-decoration-style: initial; text-decoration-color: initial;"><code 
style="font-family: Menlo, Monaco, &quot;Courier New&quot;, monospace; color: 
rgb(255, 255, 255); backgroun
 d: none; padding: 0px; border-radius: 4px; font-size: 1em; line-height: 
1.357em; display: inline-block; tab-size: 4;">
   
   ```sql
   -- Child MVs.
   CREATE MATERIALIZED VIEW mv_fact AS
   SELECT dt, k, is_dyn, sku_type
   FROM fact_src
   WHERE sku_type = '1';
   
   CREATE MATERIALIZED VIEW mv_dim_full AS
   SELECT dt, k, bu, is_dyn, sku_type
   FROM dim_full;
   
   CREATE MATERIALIZED VIEW mv_dim_full_view_non_double AS
   SELECT dt, k, mode_flag, sku_type
   FROM v_dim_full_non_double;
   
   -- Parent MV built from child MVs.
   CREATE MATERIALIZED VIEW mv_target AS
   SELECT
       t.dt,
       t.k,
       d0.bu AS out_bu,
       d1.mode_flag AS out_mode
   FROM mv_fact t
   LEFT JOIN mv_dim_full d0
     ON t.dt = d0.dt
    AND t.k = d0.k
    AND t.sku_type = d0.sku_type
    AND t.is_dyn = d0.is_dyn
   LEFT JOIN mv_dim_full_view_non_double d1
     ON t.dt = d1.dt
    AND t.k = d1.k
    AND t.sku_type = d1.sku_type;
   
   -- Query starts from the original base table and view.
   EXPLAIN
   SELECT
       t.dt,
       t.k,
       d0.bu AS out_bu,
       d1.mode_flag AS out_mode
   FROM fact_src t
   LEFT JOIN dim_full d0
     ON t.dt = d0.dt
    AND t.k = d0.k
    AND t.sku_type = d0.sku_type
    AND t.is_dyn = d0.is_dyn
   LEFT JOIN v_dim_full_non_double d1
     ON t.dt = d1.dt
    AND t.k = d1.k
    AND t.sku_type = d1.sku_type
   WHERE t.dt = '2026-02-04'
     AND t.sku_type = '1';
   ```
   </code></pre><p data-line="66" class="code-line" dir="auto" 
style="margin-top: 0px; margin-bottom: 16px; position: relative; color: 
rgb(255, 255, 255); font-family: -apple-system, &quot;system-ui&quot;, 
&quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, system-ui, Ubuntu, &quot;Droid 
Sans&quot;, sans-serif; font-size: 14px; font-style: normal; 
font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; 
letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; 
text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 
0px; white-space: normal; text-decoration-thickness: initial; 
text-decoration-style: initial; text-decoration-color: initial;">The benchmark 
has three scales:</p>
   | Scale | Shape |
   | --- | --- |
   | ordinary | 2 physical tables (`fact_src`, `dim_full`), 1 view, 4 MVs; 
query and parent MV each contain 3 scan refs and 2 joins; current 
`planChars=2176` |
   | large | 3 physical tables, 3 views, 5 MVs; includes 
fact-detail/fact-agg/dim-view/partial-join/target MV paths; current 
`planChars=3829` |
   | super | 11 physical tables, 6 views, 15 MVs in the generated benchmark 
schema; combines the minimal conflict, alias, multi-stage, nested, and large-MV 
shapes; current `planChars=5525` |
   
   All three scales assert that the target MV is chosen.
   
   ### End-to-end EXPLAIN benchmark
   
   | scale | case | baseline steadyAvgMs | current steadyAvgMs | change |
   | --- | --- | ---: | ---: | ---: |
   | ordinary | `ordinary_multi_alias_table_join_target_mv_hit` | 142.256 | 
140.238 | -1.4% |
   | large | `large_multi_alias_table_join_target_mv_hit` | 285.378 | 253.697 | 
-11.1% |
   | super | `super_multi_alias_table_join_target_mv_hit` | 527.796 | 533.037 | 
+1.0% |


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to