Skip to content

Commit c672b43

Browse files
authored
sql-faq: add missing DELAYED priority (#13523) (#13607)
1 parent 65f2b8c commit c672b43

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

faq/sql-faq.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,24 +200,23 @@ TiDB 中的 `SHOW PROCESSLIST` 与 MySQL 中的 `SHOW PROCESSLIST` 显示内容
200200

201201
TiDB 支持改变[全局](/system-variables.md#tidb_force_priority)或单个语句的优先级。优先级包括:
202202

203-
- HIGH_PRIORITY:该语句为高优先级语句,TiDB 在执行阶段会优先处理这条语句
204-
- LOW_PRIORITY:该语句为低优先级语句,TiDB 在执行阶段会降低这条语句的优先级
203+
- `HIGH_PRIORITY`:该语句为高优先级语句,TiDB 在执行阶段会优先处理这条语句
204+
- `LOW_PRIORITY`:该语句为低优先级语句,TiDB 在执行阶段会降低这条语句的优先级
205+
- `DELAYED`:该语句为正常优先级语句,TiDB 不强制改变这条语句的优先级,与 `tidb_force_priority` 设置为 `NO_PRIORITY` 相同
205206

206207
以上两种参数可以结合 TiDB 的 DML 语言进行使用,使用方法举例如下:
207208

208209
1. 通过在数据库中写 SQL 的方式来调整优先级:
209210

210-
{{< copyable "sql" >}}
211-
212211
```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;
218217
```
219218

220-
2. 全表扫会自动调整为低优先级,analyze 也是默认低优先级。
219+
2. 全表扫会自动调整为低优先级,[`ANALYZE`](/sql-statements/sql-statement-analyze-table.md) 也是默认低优先级。
221220

222221
## 在 TiDB 中 auto analyze 的触发策略是怎样的?
223222

0 commit comments

Comments
 (0)