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, statistics: async load should load all column meta info for lite init #53297

Merged
merged 4 commits into from
May 15, 2024

Conversation

winoros
Copy link
Member

@winoros winoros commented May 15, 2024

What problem does this PR solve?

Issue Number: ref #53141

Problem Summary:

What changed and how does it work?

async load should do the same thing for the lite init

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 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. labels May 15, 2024
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 15, 2024
Comment on lines 698 to 707
n.m.Lock()
n.items[col] = struct{}{}
cur := n.items[col]
if cur {
// If the existing one is full load. We don't need to update it.
n.m.Unlock()
return
}
n.items[col] = fullLoad
// Otherwise, we could safely update it.
n.m.Unlock()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use defer n.m.Unlock().

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To save performance(

Copy link

codecov bot commented May 15, 2024

Codecov Report

Attention: Patch coverage is 77.27273% with 15 lines in your changes are missing coverage. Please review.

Project coverage is 73.8291%. Comparing base (687f39c) to head (8ef215b).
Report is 1 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #53297        +/-   ##
================================================
- Coverage   74.4673%   73.8291%   -0.6383%     
================================================
  Files          1497       1497                
  Lines        356783     429959     +73176     
================================================
+ Hits         265687     317435     +51748     
- Misses        71801      92588     +20787     
- Partials      19295      19936       +641     
Flag Coverage Δ
integration 26.5423% <46.9697%> (?)
unit 71.2911% <77.2727%> (-1.9490%) ⬇️

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

Components Coverage Δ
dumpling 53.9957% <ø> (-2.3014%) ⬇️
parser ∅ <ø> (∅)
br 50.1237% <ø> (+7.1528%) ⬆️

pkg/statistics/table.go Show resolved Hide resolved
pkg/planner/core/stats.go Outdated Show resolved Hide resolved
Copy link

ti-chi-bot bot commented May 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hawkingrei, time-and-fate

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 May 15, 2024
Copy link

ti-chi-bot bot commented May 15, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-15 09:54:10.073913094 +0000 UTC m=+1647003.831048667: ☑️ agreed by hawkingrei.
  • 2024-05-15 19:27:33.799697946 +0000 UTC m=+1681407.556833516: ☑️ agreed by time-and-fate.

@ti-chi-bot ti-chi-bot bot merged commit 5d27b73 into pingcap:master May 15, 2024
23 checks passed
@winoros winoros deleted the lite-init-async-load branch May 15, 2024 20:53
@winoros
Copy link
Member Author

winoros commented May 15, 2024

/cherrypick release-8.1

@ti-chi-bot
Copy link
Member

@winoros: new pull request created to branch release-8.1: #53307.

In response to this:

/cherrypick release-8.1

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 ti-community-infra/tichi repository.

@hawkingrei
Copy link
Member

/cherrypick release-7.5

@ti-chi-bot
Copy link
Member

@hawkingrei: new pull request created to branch release-7.5: #53456.

In response to this:

/cherrypick release-7.5

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 ti-community-infra/tichi repository.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request May 21, 2024
RidRisR pushed a commit to RidRisR/tidb that referenced this pull request May 23, 2024
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants