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

statistics: Enable the priority queue to analyze all partition indexes in one go (#57258) #57285

Merged

Conversation

ti-chi-bot
Copy link
Member

@ti-chi-bot ti-chi-bot commented Nov 11, 2024

This is an automated cherry-pick of #57258

What problem does this PR solve?

Issue Number: close #57257

Problem Summary:

What changed and how does it work?

After switching to the new PQ, we only have one chance to analyze newly added indexes. For example, if two indexes are created in a very short period and the analyze version 1 is used, we need to analyze these indexes separately.

However, with the current implementation, we only analyze one index at a time, which means the second index will be missed.

In this PR, I’ve checked the analyze version to ensure proper handling. The lower versions don’t have this issue because we can analyze the second index after rebuilding the entire priority queue.

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.

使优先级队列能够一次性分析完所有分区的 index
Enable the priority queue to analyze all partition indexes in one go

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/cherry-pick-for-release-8.1 This PR is cherry-picked to release-8.1 from a source PR. labels Nov 11, 2024
@ti-chi-bot ti-chi-bot bot added do-not-merge/cherry-pick-not-approved size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cherry-pick-approved Cherry pick PR approved by release team. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. do-not-merge/cherry-pick-not-approved labels Nov 11, 2024
Signed-off-by: Rustin170506 <[email protected]>
@Rustin170506 Rustin170506 force-pushed the cherry-pick-57258-to-release-8.1 branch from 383b908 to 83438e5 Compare November 11, 2024 09:39
@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 11, 2024
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Nov 11, 2024
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 11, 2024
Copy link

ti-chi-bot bot commented Nov 11, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-11 09:41:55.500776385 +0000 UTC m=+262877.691645378: ☑️ agreed by Rustin170506.
  • 2024-11-11 09:46:51.785762312 +0000 UTC m=+263173.976631317: ☑️ agreed by qw4990.

Signed-off-by: Rustin170506 <[email protected]>
@ti-chi-bot ti-chi-bot bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. labels Nov 11, 2024
@Rustin170506 Rustin170506 changed the title statistics: make sure PQ can analyze all indexes with stats version 1 (#57258) statistics: Enable the priority queue to analyze all partition indexes in one go (#57258) Nov 11, 2024
Copy link

ti-chi-bot bot commented Nov 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qw4990, Rustin170506

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:
  • OWNERS [Rustin170506,qw4990]

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

@Rustin170506
Copy link
Member

/retest

Copy link

codecov bot commented Nov 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (release-8.1@4c32fcc). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-8.1     #57285   +/-   ##
================================================
  Coverage               ?   71.2157%           
================================================
  Files                  ?       1466           
  Lines                  ?     423269           
  Branches               ?          0           
================================================
  Hits                   ?     301434           
  Misses                 ?     101339           
  Partials               ?      20496           
Flag Coverage Δ
unit 71.2157% <100.0000%> (?)

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

Components Coverage Δ
dumpling 52.9656% <0.0000%> (?)
parser ∅ <0.0000%> (?)
br 41.3122% <0.0000%> (?)

@Rustin170506
Copy link
Member

/retest

@ti-chi-bot ti-chi-bot bot merged commit b9af20f into pingcap:release-8.1 Nov 11, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/planner SIG: Planner size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/cherry-pick-for-release-8.1 This PR is cherry-picked to release-8.1 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants