-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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: refactor the function #36603
Conversation
split GetPlanFromSessionPlanCache function into 4 functions
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
fix ci
…into refactor_plan_cache
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/1eb5094c267315ef4c7780155424d3b5ab483d81 |
/run-mysql-test |
/cc @qw4990 @Reminiscent |
Co-authored-by: Chengpeng Yan <41809508+Reminiscent@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM. @qw4990 please take a look
Co-authored-by: Chengpeng Yan <41809508+Reminiscent@users.noreply.github.com>
planner/core/plan_cache.go
Outdated
} | ||
|
||
// getParamValue get real values for "?" in PREPARE statements | ||
func getParamValue(sctx sessionctx.Context, isBinProtocol bool, binProtoVars []types.Datum, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about renaming it to parseParamTypes
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about renaming it to
parseParamTypes
?
Oops,it's indeed type
not value
planner/core/plan_cache.go
Outdated
return nil, nil, false, nil | ||
} | ||
|
||
func rebuildPhysicalPlan(ctx context.Context, sctx sessionctx.Context, is infoschema.InfoSchema, preparedStmt *CachedPrepareStmt, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is used to generate a new plan for the current statement if there is no valid plan for it.
So a name like generateNewPlan
seems better. Please rename it and add some comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 1eb5094
|
TiDB MergeCI notify✅ Well Done! New fixed [1] after this pr merged.
|
What problem does this PR solve?
Issue Number: ref #36598
Problem Summary:
The
GetPlanFromSessionPlanCache
function has too much logic to read,before general plan cache we need do some finishing.What is changed and how it works?
Split it into 4 functions.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.