Uh oh!
There was an error while loading. Please reload this page.
[fix](statistics) do not enter empty-stats fast path when any partition has data - #67542
Open
xy720 wants to merge 3 commits into
Open
[fix](statistics) do not enter empty-stats fast path when any partition has data#67542xy720 wants to merge 3 commits into
xy720 wants to merge 3 commits into
Conversation
hello-stephen
commented
Sep 5, 2026
Contributor
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
xy720
commented
Sep 5, 2026
MemberAuthor
run buildall |
hello-stephen
commented
Sep 5, 2026
Contributor
TPC-H: Total hot run time: 16564 ms |
hello-stephen
commented
Sep 5, 2026
Contributor
TPC-DS: Total hot run time: 81552 ms |
hello-stephen
commented
Sep 5, 2026
Contributor
ClickBench: Total hot run time: 14.46 s |
xy720
commented
Sep 5, 2026
MemberAuthor
run external |
xy720
commented
Sep 5, 2026
MemberAuthor
run buildall |
1 similar comment
xy720
commented
Sep 5, 2026
MemberAuthor
run buildall |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Problem Summary:
在存算分离架构中, 表/物化视图第一次写入/刷新完成后,在CloudTabletStatMgr 尚未从 MetaService 拉到最新 tablet stats 的窗口内,可能会出现rowCountReported = true 但是 OlapAnalysisTask 拿到了 rowCount=0 的过期快照,走进短路分支,直接把 count=0/ndv=0/min/max=null 的空 col stats 写进__internal_schema.column_statistics,污染 CBO 直到下一次成功 analyze 覆盖。
例子:
T1 : 创建新物化视图 mv_a
T2: 手动触发 mv_a 刷新并完成
T3: 触发 ANALYZE,此时 CloudTabletStatMgr 尚未拉取最新 rowcount,isEmptyTable 判空,写入空 col stats
T4: 基于 mv_a 的下游 mv_b 开始刷新,上游 mv 的空 col stats 使估算 cardinality=1,join order 选错,产出 BROADCAST 大表 plan,MEM_LIMIT_EXCEEDED
T5: 手动重跑 analyze 覆盖空 col stats 才恢复
修复:
仅当所有 partition 的 visibleVersion 仍为 PARTITION_INIT_VERSION(真正从未 load 过)才允许写空 stats
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)