-
Notifications
You must be signed in to change notification settings - Fork 6.1k
planner: reduce within bucket usage of range risk #65856
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
|
Hi @terry1purcell. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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. |
|
/ok-to-test |
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
Adjusts histogram range row-count estimation to reduce the effect of tidb_opt_risk_range_skew_ratio on in-bucket estimates, while still tracking a “worst-case” max estimate for planner risk evaluation.
Changes:
- Switches
BetweenRowCount’s internalrangeEstcomputation to useRowEstimatedirectly throughout. - Modifies the in-bucket skew handling to cap how much
RiskRangeSkewRatiocan inflate the default estimate, and updatesMaxEstfor risk-based comparisons. - Adds a TODO note documenting the intent and future follow-up area.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #65856 +/- ##
================================================
+ Coverage 77.7750% 78.3149% +0.5398%
================================================
Files 2001 1923 -78
Lines 545527 533123 -12404
================================================
- Hits 424284 417515 -6769
+ Misses 119581 115165 -4416
+ Partials 1662 443 -1219
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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 1 out of 1 changed files in this pull request and generated 4 comments.
Corrected a typo in a comment regarding the usage of RiskRangeSkewRatio.
|
/retest-required |
fixdb
left a comment
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.
+1
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fixdb 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 |
[LGTM Timeline notifier]Timeline:
|
|
/retest-required |
|
/retest-required |
What problem does this PR solve?
Issue Number: ref #65294
Problem Summary:
What changed and how does it work?
Variable tidb_opt_risk_range_skew_ratio can be used to adjust the estimation in 2 scenarios:
Customers attempting to use this variable to adjust only the out-of-range estimate have incurred unexpected plan changes due to the impact on "within bucket estimation".
Given that out-of-range is the more critical customer issue - this PR reduces the impact that tidb_opt_risk_range_skew_ratio has on within bucket estimation, and adds a TODO to note that further work is required if customers also experience estimation issues within histogram buckets.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.