Skip to content

Commit 1b35f74

Browse files
update description about SPM and SQL Bind (pingcap#5541)
1 parent 3ae1a33 commit 1b35f74

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

sql-plan-management.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ The default value of `tidb_evolve_plan_baselines` is `off`.
230230
>
231231
> The feature baseline evolution is not generally available for now. It is **NOT RECOMMENDED** to use it in the production environment.
232232

233-
After the automatic binding evolution feature is enabled, if the optimal execution plan selected by the optimizer is not among the binding execution plans, the optimizer marks the plan as an execution plan that waits for verification. At every `bind-info-lease` (the default value is `3s`) interval, an execution plan to be verified is selected and compared with the binding execution plan that has the least cost in terms of the actual execution time. If the plan to be verified has shorter execution time, this plan is marked as a usable binding. The following example describes the process above.
233+
After the automatic binding evolution feature is enabled, if the optimal execution plan selected by the optimizer is not among the binding execution plans, the optimizer marks the plan as an execution plan that waits for verification. At every `bind-info-lease` (the default value is `3s`) interval, an execution plan to be verified is selected and compared with the binding execution plan that has the least cost in terms of the actual execution time. If the plan to be verified has shorter execution time (the current criterion for the comparison is that the execution time of the plan to be verified is no longer than 2/3 that of the binding execution plan), this plan is marked as a usable binding. The following example describes the process above.
234234

235235
Assume that table `t` is defined as follows:
236236

@@ -264,7 +264,7 @@ The binding evolution can address this kind of issues. When the optimizer recogn
264264

265265
To reduce the impact that the automatic evolution has on clusters, use the following configurations:
266266

267-
- Set `tidb_evolve_plan_task_max_time` to limit the maximum execution time of each execution plan. The default value is `600s`.
267+
- Set `tidb_evolve_plan_task_max_time` to limit the maximum execution time of each execution plan. The default value is `600s`. In the actual verification process, the maximum execution time is also limited to no more than twice the time of the verified execution plan.
268268
- Set `tidb_evolve_plan_task_start_time` (`00:00 +0000` by default) and `tidb_evolve_plan_task_end_time` (`23:59 +0000` by default) to limit the time window.
269269

270270
### Notes

sql-statements/sql-statement-create-binding.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ The bound SQL statement is parameterized and stored in the system table. When a
1616

1717
```ebnf+diagram
1818
CreateBindingStmt ::=
19-
'CREATE' GlobalScope 'BINDING' 'FOR' SelectStmt 'USING' SelectStmt
19+
'CREATE' GlobalScope 'BINDING' 'FOR' BindableStmt 'USING' BindableStmt
2020
2121
GlobalScope ::=
2222
( 'GLOBAL' | 'SESSION' )?
2323
24-
SelectStmt ::=
25-
( SelectStmtBasic | SelectStmtFromDualTable | SelectStmtFromTable ) OrderByOptional SelectStmtLimit SelectLockOpt SelectStmtIntoOption
24+
BindableStmt ::=
25+
( SelectStmt | UpdateStmt | InsertIntoStmt | ReplaceIntoStmt | DeleteStmt )
2626
```
2727

2828
****

sql-statements/sql-statement-drop-binding.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ A `BINDING` can be on either a `GLOBAL` or `SESSION` basis. The default is `SESS
1414

1515
```ebnf+diagram
1616
DropBindingStmt ::=
17-
'DROP' GlobalScope 'BINDING' 'FOR' SelectStmt ( 'USING' SelectStmt )?
17+
'DROP' GlobalScope 'BINDING' 'FOR' BindableStmt ( 'USING' BindableStmt )?
1818
1919
GlobalScope ::=
2020
( 'GLOBAL' | 'SESSION' )?
2121
22-
SelectStmt ::=
23-
( SelectStmtBasic | SelectStmtFromDualTable | SelectStmtFromTable ) OrderByOptional SelectStmtLimit SelectLockOpt SelectStmtIntoOption
22+
BindableStmt ::=
23+
( SelectStmt | UpdateStmt | InsertIntoStmt | ReplaceIntoStmt | DeleteStmt )
2424
```
2525

2626
## Syntax description
@@ -140,4 +140,4 @@ This statement is a TiDB extension to MySQL syntax.
140140
* [SHOW [GLOBAL|SESSION] BINDINGS](/sql-statements/sql-statement-show-bindings.md)
141141
* [ANALYZE TABLE](/sql-statements/sql-statement-analyze-table.md)
142142
* [Optimizer Hints](/optimizer-hints.md)
143-
* [SQL Plan Management](/sql-plan-management.md)
143+
* [SQL Plan Management](/sql-plan-management.md)

0 commit comments

Comments
 (0)