-
Notifications
You must be signed in to change notification settings - Fork 6.1k
planner: bound the max out of range estimate | tidb-test=pr/2672 #65888
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
base: master
Are you sure you want to change the base?
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.
Pull request overview
This pull request aims to fix over-estimation issues in out-of-range row count calculations for index time ranges, addressing issue #65294 where estimates increased from ~52K to ~10M rows (193x). The changes refactor the OutOfRangeRowCount function in histogram.go to better bound maximum estimates and provide more accurate Min/Max estimate ranges.
Changes:
- Refactored
oneValuecalculation logic to handle low NDV cases more conservatively - Restructured
estRowsandmaxAddedRowscalculations with separate logic for skew ratio scenarios - Updated test expectations to include MinEst and MaxEst fields in cardinality estimation outputs
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/statistics/histogram.go | Refactors OutOfRangeRowCount function with new logic for calculating oneValue, estRows, minEst, and maxAddedRows to bound out-of-range estimates |
| tests/integrationtest/r/imdbload.result | Updates expected row count estimate from 1027.81 to 5283.37 for out-of-range query test case |
| pkg/planner/cardinality/testdata/cardinality_suite_out.json | Adds MinEst and MaxEst fields to test expectations for TestOutOfRangeEstimation cases |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #65888 +/- ##
================================================
+ Coverage 77.7546% 77.9897% +0.2350%
================================================
Files 2001 1931 -70
Lines 545989 535036 -10953
================================================
- Hits 424532 417273 -7259
+ Misses 119795 117258 -2537
+ Partials 1662 505 -1157
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Hi @terry1purcell, I noticed you mentioned me, but I couldn't find your Pantheon account linked to your GitHub account. Please connect your GitHub account to Pantheon first, and then try again. Thank you! Learn more about Pantheon AI |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
|
@terry1purcell: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: close #65294
Problem Summary:
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.