Skip to content

Conversation

@lzmhhh123
Copy link
Contributor

What is changed, added or deleted? (Required)

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • v4.0 (TiDB 4.0 versions)
  • v3.1 (TiDB 3.1 versions)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)

What is the related PR or file link(s)?

@CLAassistant
Copy link

CLAassistant commented Jun 17, 2020

CLA assistant check
All committers have signed the CLA.

@yikeke yikeke requested a review from ran-huang June 17, 2020 06:45
@yikeke yikeke added needs-cherry-pick-4.0 translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. labels Jun 17, 2020

This statement binds SQL execution plans at the GLOBAL or SESSION level. The default scope is SESSION. The bound SQL statement is parameterized and stored in the system table. When a SQL query is processed, as long as the parameterized SQL statement and a bound one in the system table are consistent and the system variable `tidb_use_plan_baselines` is set to `on` (the default value is `on`), the corresponding optimizer hint is available. If multiple execution plans are available, the optimizer chooses to bind the plan with the least cost.

When a SQL statement has bound execution plans in both GLOBAL and SESSION scopes, because the optimizer ignores the bound execution plan in the GLOBAL scope when it encounters the SESSION binding, the bound execution plan of this statement in the SESSION scope shields the execution plan in the GLOBAL scope.
Copy link
Contributor

Choose a reason for hiding this comment

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

这一段好像没有对应的中文?

@ran-huang ran-huang requested a review from bb7133 June 18, 2020 03:40
lzmhhh123 and others added 9 commits June 18, 2020 11:56
Co-authored-by: Ran <huangran@pingcap.com>
Co-authored-by: Ran <huangran@pingcap.com>
Co-authored-by: Ran <huangran@pingcap.com>
Co-authored-by: Ran <huangran@pingcap.com>
Co-authored-by: Ran <huangran@pingcap.com>
Co-authored-by: Ran <huangran@pingcap.com>
Co-authored-by: Ran <huangran@pingcap.com>
Co-authored-by: Ran <huangran@pingcap.com>
Co-authored-by: Ran <huangran@pingcap.com>
@yikeke yikeke added the status/PTAL This PR is ready for reviewing. label Jun 18, 2020
@ran-huang
Copy link
Contributor

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 19, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@lzmhhh123 merge failed.

@ran-huang
Copy link
Contributor

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ran-huang ran-huang merged commit 5e8b286 into pingcap:master Jun 19, 2020
ti-srebot pushed a commit to ti-srebot/docs that referenced this pull request Jun 19, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #2967

ran-huang pushed a commit that referenced this pull request Jun 19, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

Co-authored-by: Zhuomin(Charming) Liu <lzmhhh123@gmail.com>
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/PTAL This PR is ready for reviewing. translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants