-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
planner: fix a bug for chunk cost model. #14144
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add test for this fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reset LGTM
/run-all-tests |
@@ -176,6 +179,9 @@ func (c *Column) AvgColSizeListInDisk(count int64) float64 { | |||
// Keep two decimal place. | |||
// Minus Log2(avgSize) for unfixed-len type LEN. | |||
avgSize := float64(c.TotColSize) / float64(count) | |||
if avgSize < 1 { | |||
return math.Round((avgSize)*100) / 100 | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add unit test in testStatsSuite.TestAvgColLen
?
1822d1b
to
620f33e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
@wshwsh12 merge failed. |
/merge |
/run-all-tests |
What problem does this PR solve?
Fixes #14146
When using chunk cost model for some table, it maybe get
Can’t find a proper physical plan for this query
.What is changed and how it works?
Check
avgSize
before usingLog2(avgSize)
Check List
Tests
Code changes
Side effects
Related changes
Release note