File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -200,24 +200,23 @@ TiDB 中的 `SHOW PROCESSLIST` 与 MySQL 中的 `SHOW PROCESSLIST` 显示内容
200
200
201
201
TiDB 支持改变[全局](/system-variables.md#tidb_force_priority)或单个语句的优先级。优先级包括:
202
202
203
- - HIGH_PRIORITY:该语句为高优先级语句,TiDB 在执行阶段会优先处理这条语句
204
- - LOW_PRIORITY:该语句为低优先级语句,TiDB 在执行阶段会降低这条语句的优先级
203
+ - ` HIGH_PRIORITY` :该语句为高优先级语句,TiDB 在执行阶段会优先处理这条语句
204
+ - ` LOW_PRIORITY` :该语句为低优先级语句,TiDB 在执行阶段会降低这条语句的优先级
205
+ - ` DELAYED` :该语句为正常优先级语句,TiDB 不强制改变这条语句的优先级,与 ` tidb_force_priority` 设置为 ` NO_PRIORITY` 相同
205
206
206
207
以上两种参数可以结合 TiDB 的 DML 语言进行使用,使用方法举例如下:
207
208
208
209
1. 通过在数据库中写 SQL 的方式来调整优先级:
209
210
210
- {{< copyable " sql" > }}
211
-
212
211
` ` ` sql
213
- select HIGH_PRIORITY | LOW_PRIORITY count (* ) from table_name;
214
- insert HIGH_PRIORITY | LOW_PRIORITY into table_name insert_values;
215
- delete HIGH_PRIORITY | LOW_PRIORITY from table_name;
216
- update HIGH_PRIORITY | LOW_PRIORITY table_reference set assignment_list where where_condition;
217
- replace HIGH_PRIORITY | LOW_PRIORITY into table_name;
212
+ SELECT HIGH_PRIORITY | LOW_PRIORITY | DELAYED COUNT (* ) FROM table_name;
213
+ INSERT HIGH_PRIORITY | LOW_PRIORITY | DELAYED INTO table_name insert_values;
214
+ DELETE HIGH_PRIORITY | LOW_PRIORITY | DELAYED FROM table_name;
215
+ UPDATE HIGH_PRIORITY | LOW_PRIORITY | DELAYED table_reference SET assignment_list WHERE where_condition;
216
+ REPLACE HIGH_PRIORITY | LOW_PRIORITY | DELAYED INTO table_name;
218
217
` ` `
219
218
220
- 2. 全表扫会自动调整为低优先级,analyze 也是默认低优先级。
219
+ 2. 全表扫会自动调整为低优先级,[ ` ANALYZE ` ](/sql-statements/sql-statement- analyze-table.md) 也是默认低优先级。
221
220
222
221
# # 在 TiDB 中 auto analyze 的触发策略是怎样的?
223
222
You can’t perform that action at this time.
0 commit comments