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

*: support capture evolve plan tasks #13199

Merged
merged 4 commits into from
Nov 13, 2019
Merged

Conversation

alivxxx
Copy link
Contributor

@alivxxx alivxxx commented Nov 6, 2019

What problem does this PR solve?

Support capture evolve plan tasks, which will be used to evolve plan tasks in next pr.

What is changed and how it works?

In planner, when we found that the best plan is not in the baselines and option of evolvement has been turned on, it will cache the best plan in memory, and the background job will check the cache periodically and save it to store if there are any tasks.

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Side effects

  • None

Related changes

  • None

Release note

  • None

bindinfo/cache.go Outdated Show resolved Hide resolved
bindinfo/handle.go Show resolved Hide resolved
bindinfo/handle.go Show resolved Hide resolved
Co-Authored-By: Kenan Yao <cauchy1992@gmail.com>
Copy link
Contributor

@eurekaka eurekaka left a comment

Choose a reason for hiding this comment

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

LGTM

@eurekaka eurekaka added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 11, 2019
@codecov
Copy link

codecov bot commented Nov 12, 2019

Codecov Report

Merging #13199 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #13199   +/-   ##
===========================================
  Coverage   80.7114%   80.7114%           
===========================================
  Files           471        471           
  Lines        116079     116079           
===========================================
  Hits          93689      93689           
  Misses        15293      15293           
  Partials       7097       7097

@alivxxx alivxxx requested a review from winoros November 12, 2019 07:13
@@ -88,10 +96,13 @@ func Optimize(ctx context.Context, sctx sessionctx.Context, node ast.Node, is in
bestPlanAmongHints = plan
}
}
// If there is already a evolution task, we do not need to handle it again.
if sctx.GetSessionVars().EvolvePlanBaselines && binding == nil {
Copy link
Member

Choose a reason for hiding this comment

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

If don't want to evolve baseline or there's existing binding, can we just break and return here?

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, it needs to handle the case of UsePlanBaselines.

Copy link
Member

@winoros winoros left a comment

Choose a reason for hiding this comment

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

lgtm

@alivxxx alivxxx added status/LGT2 Indicates that a PR has LGTM 2. status/can-merge Indicates a PR has been approved by a committer. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 13, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Nov 13, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Nov 13, 2019

@lamxTyler merge failed.

@alivxxx
Copy link
Contributor Author

alivxxx commented Nov 13, 2019

/run-integration-copr-test

@alivxxx alivxxx merged commit 5873347 into pingcap:master Nov 13, 2019
@alivxxx alivxxx deleted the add-evolve-task branch November 13, 2019 08:22
XiaTianliang pushed a commit to XiaTianliang/tidb that referenced this pull request Dec 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/new-feature type/usability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants