Skip to content
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: notify skyline pruning of index statistics availability #59110

Merged
merged 3 commits into from
Jan 26, 2025

Conversation

terry1purcell
Copy link
Contributor

@terry1purcell terry1purcell commented Jan 22, 2025

Extend support for skyline pruning recognition of index without statistics to existing rules.

By passing the "pseudo" result of the index from the CompareCandidates function for the "successful" index - it allows the later checking in SkyLinePruning to keep that index to prioritize above a table scan if tidb_opt_prefer_range_scan global variable is set.

This change is a minor addition to address prior customer concerns that a newly created index that does NOT yet have statistics may be selected by the existing CompareCandidates code - and the index WITH statistics is pruned. But the cost of the index that used defaults (since no statistics) may have a higher cost than tablescan.

What problem does this PR solve?

Issue Number: close #57948

Problem Summary:

What changed and how does it work?

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 ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 22, 2025
Copy link

tiprow bot commented Jan 22, 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.

Copy link

codecov bot commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 72.72727% with 3 lines in your changes missing coverage. Please review.

Project coverage is 73.3397%. Comparing base (aabd3ac) to head (bd6f4a7).
Report is 33 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #59110        +/-   ##
================================================
+ Coverage   73.0284%   73.3397%   +0.3113%     
================================================
  Files          1683       1689         +6     
  Lines        466099     481065     +14966     
================================================
+ Hits         340385     352812     +12427     
- Misses       104791     106579      +1788     
- Partials      20923      21674       +751     
Flag Coverage Δ
integration 42.9797% <36.3636%> (?)
unit 72.2378% <72.7272%> (+0.0306%) ⬆️

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

Components Coverage Δ
dumpling 52.6910% <ø> (ø)
parser ∅ <ø> (∅)
br 44.1372% <ø> (-1.1776%) ⬇️

@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 22, 2025
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 23, 2025
@terry1purcell terry1purcell requested a review from winoros January 25, 2025 18:42
Copy link

ti-chi-bot bot commented Jan 26, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hawkingrei, winoros

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

The pull request process is described 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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 26, 2025
Copy link

ti-chi-bot bot commented Jan 26, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-01-23 03:18:15.545110075 +0000 UTC m=+323622.876029478: ☑️ agreed by hawkingrei.
  • 2025-01-26 02:22:21.797797376 +0000 UTC m=+579469.128716780: ☑️ agreed by winoros.

@ti-chi-bot ti-chi-bot bot merged commit 5ba9e6f into pingcap:master Jan 26, 2025
23 of 24 checks passed
@terry1purcell terry1purcell deleted the idxpseudorange branch January 26, 2025 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update table statistics before publishing new schema version after DDL
3 participants