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: fix the issue that some PointGet plans generated in physical-stage cannot be cached #28478

Merged
merged 17 commits into from
Oct 9, 2021

Conversation

qw4990
Copy link
Contributor

@qw4990 qw4990 commented Sep 29, 2021

What problem does this PR solve?

Issue Number: close #26868, close #26873

Problem Summary: planner: fix the issue that some PointGet plans generated in physical-stage cannot be cached

What is changed and how it works?

planner: fix the issue that some PointGet plans generated in physical-stage cannot be cached

Check List

Tests

  • Unit test

Release note

planner: fix the issue that some PointGet plans generated in physical-stage cannot be cached

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 29, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Reminiscent
  • xuyifangreeneyes

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 29, 2021
@qw4990 qw4990 added type/enhancement The issue or PR belongs to an enhancement. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 29, 2021
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 8, 2021
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 8, 2021
@@ -1107,7 +1149,7 @@ func (s *testPlanSerialSuite) TestPlanCachePointGetAndTableDual(c *C) {
tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0"))
// Must not reuse the previous TableDual plan.
Copy link
Contributor

@Reminiscent Reminiscent Oct 8, 2021

Choose a reason for hiding this comment

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

Please update the comments. The following changes are the same. Maybe we need to check the plan to show the result.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All related comments have been updated.

@@ -1118,7 +1160,7 @@ func (s *testPlanSerialSuite) TestPlanCachePointGetAndTableDual(c *C) {
tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0"))
// Must not reuse the previous PointGet plan.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we modify or remove comments like this? Otherwise it may be confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All related comments have been updated.

Comment on lines -346 to -347
// TODO: Can we make a more careful check on whether the optimization depends on mutable constants?
ds.ctx.GetSessionVars().StmtCtx.MaybeOverOptimized4PlanCache = true
Copy link
Contributor

@Reminiscent Reminiscent Oct 8, 2021

Choose a reason for hiding this comment

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

Please add the test cases from #26873.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A new test case TestIssue26873 is added.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Oct 9, 2021
@qw4990
Copy link
Contributor Author

qw4990 commented Oct 9, 2021

/run-all-teests

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Oct 9, 2021
@qw4990
Copy link
Contributor Author

qw4990 commented Oct 9, 2021

�/merge

@qw4990
Copy link
Contributor Author

qw4990 commented Oct 9, 2021

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 98c8b33

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 9, 2021
@qw4990
Copy link
Contributor Author

qw4990 commented Oct 9, 2021

/merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
4 participants