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

Recommend RC instead of SQL Priority (#19605) #19628

Merged
Merged
Show file tree
Hide file tree
Changes from all 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: 3 additions & 1 deletion faq/sql-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@

## How to prevent the execution of a particular SQL statement?

You can create [SQL bindings](/sql-plan-management.md#sql-binding) with the [`MAX_EXECUTION_TIME`](/optimizer-hints.md#max_execution_timen) hint to limit the execution time of a particular statement to a small value (for example, 1ms). In this way, the statement is terminated automatically by the threshold.
For TiDB v7.5.0 or later versions, you can use the [`QUERY WATCH`](/sql-statements/sql-statement-query-watch.md) statement to terminate specific SQL statements. For more details, see [Manage queries that consume more resources than expected (Runaway Queries)](/tidb-resource-control.md#query-watch-parameters).

For versions earlier than TiDB v7.5.0, you can create [SQL bindings](/sql-plan-management.md#sql-binding) with the [`MAX_EXECUTION_TIME`](/optimizer-hints.md#max_execution_timen) hint to limit the execution time of a particular statement to a small value (for example, 1ms). In this way, the statement is terminated automatically by the threshold.

Check failure on line 37 in faq/sql-faq.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [PingCAP.Units] Put a nonbreaking space between the number and the unit in '1ms'. Raw Output: {"message": "[PingCAP.Units] Put a nonbreaking space between the number and the unit in '1ms'.", "location": {"path": "faq/sql-faq.md", "range": {"start": {"line": 37, "column": 270}}}, "severity": "ERROR"}

For example, to prevent the execution of `SELECT * FROM t1, t2 WHERE t1.id = t2.id`, you can use the following SQL binding to limit the execution time of the statement to 1ms:

Expand Down
4 changes: 4 additions & 0 deletions sql-statements/sql-statement-insert.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ OnDuplicateKeyUpdate ::=
( 'ON' 'DUPLICATE' 'KEY' 'UPDATE' AssignmentList )?
```

> **Note:**
>
> Starting from v6.6.0, TiDB supports [Resource Control](/tidb-resource-control.md). You can use this feature to execute SQL statements with different priorities in different resource groups. By configuring proper quotas and priorities for these resource groups, you can gain better scheduling control for SQL statements with different priorities. When resource control is enabled, statement priority (`PriorityOpt`) will no longer take effect. It is recommended that you use [Resource Control](/tidb-resource-control.md) to manage resource usage for different SQL statements.

## Examples

```sql
Expand Down
4 changes: 4 additions & 0 deletions sql-statements/sql-statement-replace.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ InsertValues ::=
| 'SET' ColumnSetValue? ( ',' ColumnSetValue )*
```

> **Note:**
>
> Starting from v6.6.0, TiDB supports [Resource Control](/tidb-resource-control.md). You can use this feature to execute SQL statements with different priorities in different resource groups. By configuring proper quotas and priorities for these resource groups, you can gain better scheduling control for SQL statements with different priorities. When resource control is enabled, statement priority (`PriorityOpt`) will no longer take effect. It is recommended that you use [Resource Control](/tidb-resource-control.md) to manage resource usage for different SQL statements.

## Examples

```sql
Expand Down
4 changes: 4 additions & 0 deletions sql-statements/sql-statement-select.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ TableSampleOpt ::=
|`LOCK IN SHARE MODE` | To guarantee compatibility, TiDB parses these three modifiers, but will ignore them. |
| `TABLESAMPLE` | To get a sample of rows from the table. |

> **Note:**
>
> Starting from v6.6.0, TiDB supports [Resource Control](/tidb-resource-control.md). You can use this feature to execute SQL statements with different priorities in different resource groups. By configuring proper quotas and priorities for these resource groups, you can gain better scheduling control for SQL statements with different priorities. When resource control is enabled, statement priority (`HIGH_PRIORITY`) will no longer take effect. It is recommended that you use [Resource Control](/tidb-resource-control.md) to manage resource usage for different SQL statements.

## Examples

### SELECT
Expand Down
4 changes: 4 additions & 0 deletions sql-statements/sql-statement-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ The `UPDATE` statement is used to modify data in a specified table.

![WhereClauseOptional](/media/sqlgram/WhereClauseOptional.png)

> **Note:**
>
> Starting from v6.6.0, TiDB supports [Resource Control](/tidb-resource-control.md). You can use this feature to execute SQL statements with different priorities in different resource groups. By configuring proper quotas and priorities for these resource groups, you can gain better scheduling control for SQL statements with different priorities. When resource control is enabled, statement priority (`LOW_PRIORITY` and `HIGH_PRIORITY`) will no longer take effect. It is recommended that you use [Resource Control](/tidb-resource-control.md) to manage resource usage for different SQL statements.

## Examples

```sql
Expand Down
Loading