[Bug](mtmv) fix MV refresh stuck due to precision-lossy hot value collection - #67354
Open
xy720 wants to merge 1 commit into
Open
[Bug](mtmv) fix MV refresh stuck due to precision-lossy hot value collection#67354xy720 wants to merge 1 commit into
xy720 wants to merge 1 commit into
Conversation
xy720
requested review from
924060929,
englefly,
morrySnow and
starocean999
as code owners
August 31, 2026 22:56
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Member
Author
|
run buildall |
Contributor
TPC-H: Total hot run time: 16854 ms |
Contributor
TPC-DS: Total hot run time: 82431 ms |
Contributor
ClickBench: Total hot run time: 14.83 s |
Contributor
FE UT Coverage ReportIncrement line coverage |
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 free
to 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?
Root cause chain:
1. Analyze sample round hot_values with
ROUND(count / rowCount, 2)), a value with true ratio 0.1858% is rounded as 0.00.2. FilterEstimation.estimateColumnEqualToConstant unconditionally overwrites 1/ndv with the 0.00 hot value ratio.
3. Filter output rowCount collapses to 0.
4. InitJoinOrder's
left > 0guard rejects the swap.5. JoinEstimation floors row count back to 1 via Math.max(1, ...).
6. Plan generated wrong join order, the huge side becomes hash build side and the mv refresh failed.
Triggered this bug by enabling force_sample_analyze=true globally in our customers cluster,
which manual ANALYZE through the sample path that collects hot values.
Fix (three-in-one, all minimal):
to the uniform 1/ndv estimate.
left > 0toleft >= 0; the downstream Math.max(1, ..)in JoinEstimation already prevents any loop from truly-negative estimates.
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)