HappenLee opened a new pull request, #69042: URL: https://github.com/apache/doris/pull/69042
### What problem does this PR solve? Related PR: #68312 `agg_state_finalize_roll_up` can fail its chosen-MV assertion even when rewriting succeeds. In [CloudP0 build 1066869](http://43.132.222.7:8111/buildConfiguration/Doris_DorisRegression_CloudP0/1066869), both the 700-row base table and `finalize_sum_mv` were estimated at one row, and EXPLAIN reported `finalize_sum_mv not chose`. Synchronous ANALYZE does not wait for tablet row-count reporting. The existing data amplification therefore does not guarantee a cost advantage for the MV when those reports are stale. Pin the actual fixture cardinalities using the existing `ALTER COLUMN SET STATS` mechanism: 700 base rows, five rows in each successful `(k, g)` MV, and three distinct `k` values. This supplies stable statistics to both the base-table and MV scan paths. Keep the strict chosen-MV assertions for both finalizer queries and the existing MERGE/UNION rollup, the MAX/ABS rejection checks, all inserted data, and the expected result file unchanged. No production optimizer or aggregation code changes. ### Release note None ### Check List (For Author) - Test: - [x] Regression test: five consecutive ordinary comparison runs of `agg_state_finalize_roll_up` passed on a dedicated local ASAN cluster, with tablet row-count refresh/report intervals set to 600 seconds. Used the same CI binary package as the reported failure (`doris-0.0.0-a1f5d53acf`), which includes #68312. The test source matches current master; no expected-output generation or edits were needed. - [x] Controlled reproduction: temporarily setting the pre-fix base-table estimate to one row reproduced the same `finalize_sum_mv not chose` assertion failure. The temporary reproduction change is not included in this PR. - [x] Regression framework build: 41 framework tests passed. `git diff --check` passed. - Full CloudP0 has not been rerun locally; local validation used shared-nothing mode to exercise the same statistics-sensitive MV-selection assertion. - Behavior changed: - [x] No. Regression fixture statistics only. - [ ] Yes. - Does this need documentation? - [x] No. - [ ] Yes. -- 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]
