github-actions[bot] commented on code in PR #69042:
URL: https://github.com/apache/doris/pull/69042#discussion_r4263581335


##########
regression-test/suites/nereids_rules_p0/mv/agg_with_roll_up/agg_state_finalize_roll_up.groovy:
##########
@@ -39,6 +39,12 @@ suite("agg_state_finalize_roll_up") {
         select k, g, v from agg_finalize_rollup_input cross join 
numbers("number"="99")
     """
     sql "analyze table agg_finalize_rollup_input with sync"
+    // Synchronous ANALYZE does not wait for tablet row-count reports. Pin the 
fixture
+    // cardinalities so CBO chooses the rollup independently of report timing.
+    sql """
+        alter table agg_finalize_rollup_input modify column k
+        set stats ('row_count'='700', 'ndv'='3')

Review Comment:
   [P2] Protect the statistics pins from queued automatic cleanup
   
   A default CloudP0 automatic-analysis job can already be queued for this 
table before this pin. If CloudTabletStatMgr's tablet snapshot misses the newly 
created table, its later fresh-table summary can mark the replicas' default 
zero row count as reported. StatisticsAutoCollector.readyToSample processes 
that pending job before the userInjected filter and deletes the nonempty 
table/column statistics, including this 700-row pin. If cleanup runs after 
finalize_sum_mv builds its statistics cache but before these assertions, the 
base scan falls back to one row while the MV retains its cached 3.375-row 
estimate (or pinned five-row fallback), allowing CBO to prefer the base and 
fail the strict chosen-MV checks again. The fixture needs to exclude queued 
background cleanup, or ensure the collector honors injected statistics before 
its empty-table cleanup, before relying on these pins.



-- 
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