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

resource_control: add note for the conflict between resource control and sql priority #16591

Merged
merged 7 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions faq/sql-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ TiDB 支持改变[全局](/system-variables.md#tidb_force_priority)或单个语
- `LOW_PRIORITY`:该语句为低优先级语句,TiDB 在执行阶段会降低这条语句的优先级
- `DELAYED`:该语句为正常优先级语句,TiDB 不强制改变这条语句的优先级,与 `tidb_force_priority` 设置为 `NO_PRIORITY` 相同

> **注意:**
>
> TiDB 从 v6.6.0 版本开始支持[使用资源管控 (Resource Control) 实现资源隔离](/tidb-resource-control.md) 功能。该功能可以将不同优先级的语句放在不同的资源组中执行,并为这些资源组分配不同的配额和优先级,可以达到更好的资源管控效果。在开启资源管控功能后,语句的调度主要受资源组的控制,`PRIORITY` 将不再生效。建议在支持资源管控的版本优先使用资源管控功能。
hfxsd marked this conversation as resolved.
Show resolved Hide resolved

hfxsd marked this conversation as resolved.
Show resolved Hide resolved
以上两种参数可以结合 TiDB 的 DML 语言进行使用,使用方法举例如下:

1. 通过在数据库中写 SQL 的方式来调整优先级:
Expand Down
4 changes: 4 additions & 0 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -2505,6 +2505,10 @@ v5.0 后,用户仍可以单独修改以上系统变量(会有废弃警告)
- 这个变量用于改变 TiDB server 上执行的语句的默认优先级。例如,你可以通过设置该变量来确保正在执行 OLAP 查询的用户优先级低于正在执行 OLTP 查询的用户。
- 默认值 `NO_PRIORITY` 表示不强制改变执行语句的优先级。

> **注意:**
>
> TiDB 从 v6.6.0 版本开始支持[使用资源管控 (Resource Control) 实现资源隔离](/tidb-resource-control.md) 功能。该功能可以将不同优先级的语句放在不同的资源组中执行,并为这些资源组分配不同的配额和优先级,可以达到更好的资源管控效果。在开启资源管控功能后,语句的调度主要受资源组的控制,`PRIORITY` 将不再生效。建议在支持资源管控的版本优先使用资源管控功能。
hfxsd marked this conversation as resolved.
Show resolved Hide resolved

### `tidb_gc_concurrency` <span class="version-mark">从 v5.0 版本开始引入</span>

- 作用域:GLOBAL
Expand Down
8 changes: 8 additions & 0 deletions tidb-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,10 @@ TiDB 配置文件比命令行参数支持更多的选项。你可以在 [config/
+ 可选值:默认值 NO_PRIORITY 表示不强制改变执行语句的优先级,其它优先级从低到高可设置为 LOW_PRIORITY、DELAYED 或 HIGH_PRIORITY。
+ 自 v6.1.0 起,已改用配置项 [`instance.tidb_force_priority`](/tidb-configuration-file.md#tidb_force_priority) 或系统变量 [`tidb_force_priority`](/system-variables.md#tidb_force_priority) 来将所有语句优先级设为 force-priority 的值。`force-priority` 仍可使用,但如果同时设置了 `force-priority` 与 `instance.tidb_force_priority`,TiDB 将采用 `instance.tidb_force_priority` 的值。

> **注意:**
>
> TiDB 从 v6.6.0 版本开始支持[使用资源管控 (Resource Control) 实现资源隔离](/tidb-resource-control.md) 功能。该功能可以将不同优先级的语句放在不同的资源组中执行,并为这些资源组分配不同的配额和优先级,可以达到更好的资源管控效果。在开启资源管控功能后,语句的调度主要受资源组的控制,`PRIORITY` 将不再生效。建议在支持资源管控的版本优先使用资源管控功能。
hfxsd marked this conversation as resolved.
Show resolved Hide resolved

### `distinct-agg-push-down`

+ 设置优化器是否执行将带有 `Distinct` 的聚合函数(比如 `select count(distinct a) from t`)下推到 Coprocessor 的优化操作。
Expand Down Expand Up @@ -881,6 +885,10 @@ TiDB 服务状态相关配置。
+ 默认值 NO_PRIORITY 表示不强制改变执行语句的优先级,其它优先级从低到高可设置为 LOW_PRIORITY、DELAYED 或 HIGH_PRIORITY。
+ 在 v6.1.0 之前,该功能通过配置项 `force-priority` 进行设置。

> **注意:**
>
> TiDB 从 v6.6.0 版本开始支持[使用资源管控 (Resource Control) 实现资源隔离](/tidb-resource-control.md) 功能。该功能可以将不同优先级的语句放在不同的资源组中执行,并为这些资源组分配不同的配额和优先级,可以达到更好的资源管控效果。在开启资源管控功能后,语句的调度主要受资源组的控制,`PRIORITY` 将不再生效。建议在支持资源管控的版本优先使用资源管控功能。
hfxsd marked this conversation as resolved.
Show resolved Hide resolved

### `max_connections`

+ TiDB 中同时允许的最大客户端连接数,用于资源控制。
Expand Down
Loading