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: simplify plan cache for fast point get #53094

Merged
merged 5 commits into from
May 8, 2024

Conversation

qw4990
Copy link
Contributor

@qw4990 qw4990 commented May 8, 2024

What problem does this PR solve?

Issue Number: ref #50618

Problem Summary: planner: simplify plan cache for fast point get

What changed and how does it work?

planner: simplify plan cache for fast point get

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 sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 8, 2024
Copy link

codecov bot commented May 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.8226%. Comparing base (2b754c7) to head (3c908d3).
Report is 5 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #53094        +/-   ##
================================================
+ Coverage   72.4215%   74.8226%   +2.4010%     
================================================
  Files          1490       1491         +1     
  Lines        428984     432166      +3182     
================================================
+ Hits         310677     323358     +12681     
+ Misses        99041      88954     -10087     
- Partials      19266      19854       +588     
Flag Coverage Δ
integration 49.4684% <85.7142%> (?)
unit 71.6097% <100.0000%> (+0.3084%) ⬆️

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 50.4183% <ø> (+9.0763%) ⬆️

@qw4990
Copy link
Contributor Author

qw4990 commented May 8, 2024

/test check-dev2

Copy link

tiprow bot commented May 8, 2024

@qw4990: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test check-dev2

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.

)

if plan, _ok := p.(*PointGetPlan); _ok {
ok = IsPointGetWithPKOrUniqueKeyByAutoCommit(sctx.GetSessionVars(), p)
Copy link
Contributor

Choose a reason for hiding this comment

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

In the new code logic, don't we need to check "IsPointGetWithPKOrUniqueKeyByAutoCommit" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, this check is unnecessary for Plan Cache, we only need to check whether the Plan is *PointGetPlan.

@@ -1708,7 +1708,7 @@ func TestFixControl33031(t *testing.T) {
tk.MustExec(`set @a = 1`)
tk.MustQuery(`execute stmt using @a`).Check(testkit.Rows("1 1"))
require.False(t, tk.Session().GetSessionVars().FoundInPlanCache)
tk.MustQuery(`show warnings`).Check(testkit.Rows("Warning 1105 skip plan-cache: plan rebuild failed, Fix33031 fix-control set and partitioned table in cached Point Get plan", "Warning 1105 skip plan-cache: plan rebuild failed, Fix33031 fix-control set and partitioned table in cached Point Get plan"))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

2 duplicated warnings, after this PR, no such duplication.

Copy link

ti-chi-bot bot commented May 8, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-08 05:56:50.537089105 +0000 UTC m=+1027964.294224902: ☑️ agreed by AilinKid.
  • 2024-05-08 06:26:18.337969393 +0000 UTC m=+1029732.095104965: ☑️ agreed by time-and-fate.

Copy link
Contributor

@elsa0520 elsa0520 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

ti-chi-bot bot commented May 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AilinKid, elsa0520, 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

@qw4990
Copy link
Contributor Author

qw4990 commented May 8, 2024

/test check-dev2

Copy link

tiprow bot commented May 8, 2024

@qw4990: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test check-dev2

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.

@qw4990
Copy link
Contributor Author

qw4990 commented May 8, 2024

/test check-dev2

Copy link

tiprow bot commented May 8, 2024

@qw4990: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test check-dev2

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.

@ti-chi-bot ti-chi-bot bot merged commit 50b8dfa into pingcap:master May 8, 2024
23 checks passed
terry1purcell pushed a commit to terry1purcell/tidb that referenced this pull request May 17, 2024
RidRisR pushed a commit to RidRisR/tidb that referenced this pull request May 23, 2024
qw4990 added a commit to qw4990/tidb that referenced this pull request May 29, 2024
ti-chi-bot bot pushed a commit that referenced this pull request May 29, 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 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.

None yet

5 participants