Skip to content

Conversation

@terry1purcell
Copy link
Contributor

@terry1purcell terry1purcell commented Nov 14, 2025

What problem does this PR solve?

Issue Number: ref #64378

Problem Summary:

What changed and how does it work?

Out of range estimation uses a time decay concept - the further out of range you search, the lower the percentage estimate. This time decay can cause an issue for customers with very large tables who may run ANALYZE less often. If the predicate uses a search range that moves forward each day, but the ANALYZE is rerun - then the estimate will be reduced each day that the predicate moves away from the statistics.

This PR adds a compensation for the time decay by evaluating the estimate if the range was closer to the histogram high range, and adjusts the estimate accordingly.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot
Copy link

ti-chi-bot bot commented Nov 14, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign time-and-fate for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 14, 2025
@tiprow
Copy link

tiprow bot commented Nov 14, 2025

Hi @terry1purcell. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions 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.

@terry1purcell terry1purcell changed the title planner: Adjust out of range for time deccay planner: Adjust out of range for time decay Nov 14, 2025
@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.9179%. Comparing base (b0d1993) to head (81d393b).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #64486        +/-   ##
================================================
+ Coverage   72.6893%   72.9179%   +0.2286%     
================================================
  Files          1866       1888        +22     
  Lines        506220     514212      +7992     
================================================
+ Hits         367968     374953      +6985     
- Misses       115870     116153       +283     
- Partials      22382      23106       +724     
Flag Coverage Δ
integration 52.3644% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.8700% <ø> (ø)
parser ∅ <ø> (∅)
br 46.1887% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Nov 14, 2025

@terry1purcell: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-tidb/mysql-test 81d393b link true /test mysql-test
idc-jenkins-ci-tidb/check_dev 81d393b link true /test check-dev
idc-jenkins-ci-tidb/check_dev_2 81d393b link true /test check-dev2
idc-jenkins-ci-tidb/unit-test 81d393b link true /test unit-test
pull-unit-test-next-gen 81d393b link true /test pull-unit-test-next-gen

Full PR test history. Your PR dashboard.

Instructions 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/statistics release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant