diff --git a/TOC-tidb-cloud-essential.md b/TOC-tidb-cloud-essential.md
index 697c30ab0ce5f..bbf467c97e340 100644
--- a/TOC-tidb-cloud-essential.md
+++ b/TOC-tidb-cloud-essential.md
@@ -557,6 +557,7 @@
- [Server Status Variables](/status-variables.md)
- [Table Filter](/table-filter.md)
- [URI Formats of External Storage Services](/external-storage-uri.md)
+ - [Configure Trigger Rules for Slow Queries](/config-slow-query-trigger-rules.md)
- [Troubleshoot Inconsistency Between Data and Indexes](/troubleshoot-data-inconsistency-errors.md)
- [Notifications](/tidb-cloud/notifications.md)
- [Project API Migration Guide for {{{ .starter }}} and Essential](/tidb-cloud/tidbx-starter-essential-project-api-migration-guide.md)
diff --git a/TOC-tidb-cloud-premium.md b/TOC-tidb-cloud-premium.md
index 4467337ad6a4f..73aa1ebc6c10e 100644
--- a/TOC-tidb-cloud-premium.md
+++ b/TOC-tidb-cloud-premium.md
@@ -479,6 +479,7 @@
- [Table Filter](/table-filter.md)
- [URI Formats of External Storage Services](/external-storage-uri.md)
- [`ANALYZE` Embedded in DDL Statements](/ddl_embedded_analyze.md)
+ - [Configure Trigger Rules for Slow Queries](/config-slow-query-trigger-rules.md)
- [Troubleshoot Inconsistency Between Data and Indexes](/troubleshoot-data-inconsistency-errors.md)
- [Notifications](/tidb-cloud/notifications.md)
- Support Plan
diff --git a/TOC.md b/TOC.md
index 65231d45c782a..3dde182c31e3b 100644
--- a/TOC.md
+++ b/TOC.md
@@ -213,6 +213,7 @@
- Issue Scenarios
- Slow Queries
- [Identify Slow Queries](/identify-slow-queries.md)
+ - [Configure Trigger Rules for Slow Queries](/config-slow-query-trigger-rules.md)
- [Analyze Slow Queries](/analyze-slow-queries.md)
- [TiDB OOM](/troubleshoot-tidb-oom.md)
- [Hotspot](/troubleshoot-hot-spot-issues.md)
diff --git a/config-slow-query-trigger-rules.md b/config-slow-query-trigger-rules.md
new file mode 100644
index 0000000000000..b40d4ce86db7b
--- /dev/null
+++ b/config-slow-query-trigger-rules.md
@@ -0,0 +1,195 @@
+---
+title: Configure Trigger Rules for Slow Queries
+summary: Define the trigger rules for slow query logs.
+---
+
+# Configure Trigger Rules for Slow Queries
+
+
+
+This document describes how to use the [`tidb_slow_log_rules`](/system-variables.md#tidb_slow_log_rules) system variable to define the trigger rules for [slow query logs](/identify-slow-queries.md).
+
+[`tidb_slow_log_rules`](/system-variables.md#tidb_slow_log_rules) supports multi-dimensional metric combinations. It is suitable for "targeted sampling" and "problem reproduction" of slow query logs, enabling you to filter target statements based on specific metric combinations.
+
+For TiDB Self-Managed, the triggering behavior of slow query logs depends on the configuration of `tidb_slow_log_rules`:
+
+- If the current session has no applicable `tidb_slow_log_rules` rule (either because this variable is not set or because none of the configured rules apply to the session), slow query logging still relies on [`tidb_slow_log_threshold`](/system-variables.md#tidb_slow_log_threshold) (in milliseconds).
+- If the current session has any applicable `tidb_slow_log_rules` rules, slow query logging is determined by the rule matching results, and [`tidb_slow_log_threshold`](/system-variables.md#tidb_slow_log_threshold) is ignored.
+
+
+
+
+In the [TiDB Cloud console](https://tidbcloud.com/), you can view slow queries on the [**Slow Query**](/tidb-cloud/tune-performance.md#slow-query) tab of the [**Diagnosis**](/tidb-cloud/tune-performance.md#view-the-diagnosis-page) page.
+
+By default, SQL queries that take more than 300 milliseconds are considered as slow queries. To configure the trigger rules for slow queries, you can modify the [`tidb_slow_log_rules`](/system-variables.md#tidb_slow_log_rules) system variable.
+
+[`tidb_slow_log_rules`](/system-variables.md#tidb_slow_log_rules) supports multi-dimensional metric combinations. It is suitable for "targeted sampling" and "problem reproduction" of slow queries, enabling you to filter target statements based on specific metric combinations.
+
+
+
+## Examples
+
+- Standard format (`SESSION` scope):
+
+ ```sql
+ SET SESSION tidb_slow_log_rules = 'Query_time: 0.5, Is_internal: false';
+ ```
+
+- Invalid `SESSION` rule (`SESSION` scope does not support `Conn_ID`):
+
+ ```sql
+ SET SESSION tidb_slow_log_rules = 'Conn_ID: 12, Query_time: 0.5, Is_internal: false';
+ ```
+
+
+
+- Global rule (applies to all connections):
+
+ ```sql
+ SET GLOBAL tidb_slow_log_rules = 'Query_time: 0.5, Is_internal: false';
+ ```
+
+- Global rules for specific connections (applied separately to the two connections `Conn_ID:11` and `Conn_ID:12`):
+
+ ```sql
+ SET GLOBAL tidb_slow_log_rules = 'Conn_ID: 11, Query_time: 0.5, Is_internal: false; Conn_ID: 12, Query_time: 0.6, Process_time: 0.3, DB: db1';
+ ```
+
+
+
+
+
+- Global rule (applies to all connections):
+
+ ```sql
+ SET GLOBAL tidb_slow_log_rules = 'Query_time: 0.5, Is_internal: false';
+ ```
+
+- Global rules for specific connections (applied separately to the two connections `Conn_ID:11` and `Conn_ID:12`):
+
+ ```sql
+ SET GLOBAL tidb_slow_log_rules = 'Conn_ID: 11, Query_time: 0.5, Is_internal: false; Conn_ID: 12, Query_time: 0.6, Process_time: 0.3, DB: db1';
+ ```
+
+
+
+## Unified rule syntax and type constraints
+
+- Rule capacity and separation: each supported scope can contain a maximum of 10 rules. Rules are separated by `;`.
+- Condition format: each condition uses the format `field_name:value`. Multiple conditions within a single rule are separated by `,`.
+- Field names are case-insensitive. Underscores and other characters in field names are preserved.
+
+
+
+TiDB Self-Managed supports both `SESSION` and `GLOBAL` rules for `tidb_slow_log_rules`. A single session can have up to 20 active rules across the two scopes. `SESSION` rules do not support `Conn_ID`; only `GLOBAL` rules support this field.
+
+
+
+
+
+TiDB Cloud Dedicated supports both `SESSION` and `GLOBAL` rules for `tidb_slow_log_rules`. A single session can have up to 20 active rules across the two scopes. `SESSION` rules do not support `Conn_ID`; only `GLOBAL` rules support this field.
+
+
+
+
+
+TiDB Cloud Essential and TiDB Cloud Premium support only `SESSION` rules for `tidb_slow_log_rules`. Therefore, `Conn_ID`, which is available only in `GLOBAL` rules, is not supported.
+
+
+
+- Matching semantics:
+ - Numeric fields except `Conn_ID` are matched using `>=`. `Conn_ID`, string fields, and boolean fields are matched using equality (`=`).
+ - Matching for `DB` and `Resource_group` is case-insensitive.
+ - Explicit operators such as `>`, `<`, and `!=` are not supported.
+
+Type constraints are as follows:
+
+- Numeric types (`int64`, `uint64`, `float64`) require values greater than or equal to `0`. Negative values result in a parsing error.
+ - `int64`: the maximum value is `2^63-1`.
+ - `uint64`: the maximum value is `2^64-1`.
+ - `float64`: values must be finite and non-negative. The maximum value is approximately `1.79e308`. `NaN` and infinite values such as `Inf` and `-Inf` are invalid and result in an error.
+- `bool`: supports `true`/`false`, `1`/`0`, and `t`/`f` (case-insensitive).
+- `string`: currently does not support strings containing the separators `,` (condition separator) or `;` (rule separator), even with quotes (single or double). Escaping is not supported.
+- Duplicate fields: if the same field is specified multiple times in a single rule, the last occurrence takes effect.
+
+## Supported fields
+
+The fields in the following table follow the general matching and type rules described in [Unified rule syntax and type constraints](#unified-rule-syntax-and-type-constraints), unless otherwise noted.
+
+| Field name | Type | Unit | Description |
+| --- | --- | --- | --- |
+| `Conn_ID` | `uint` | count | The connection ID (session ID). This field uses exact matching. For example, `Conn_ID:3` matches only logs whose session ID is `3`. This field is supported only in `GLOBAL` rules. |
+| `Session_alias` | `string` | none | The alias of the current session. |
+| `DB` | `string` | none | The current database. Matching is case-insensitive. |
+| `Exec_retry_count` | `uint` | count | The retry times of this statement. This field is usually for pessimistic transactions in which the statement is retried when the lock fails. |
+| `Query_time` | `float` | second | The execution time of a statement. |
+| `Parse_time` | `float` | second | The parsing time for the statement. |
+| `Compile_time` | `float` | second | The duration of the query optimization. |
+| `Rewrite_time` | `float` | second | The time consumed for rewriting the query of this statement. |
+| `Optimize_time` | `float` | second | The time consumed for optimizing the execution plan. |
+| `Wait_TS` | `float` | second | The waiting time of the statement to get transaction timestamps. |
+| `Is_internal` | `bool` | none | Whether a SQL statement is internal to TiDB. `true` indicates that the statement is executed internally in TiDB, and `false` indicates that the statement is executed by the user. |
+| `Digest` | `string` | none | The fingerprint of the SQL statement. |
+| `Plan_digest` | `string` | none | The digest of the execution plan. |
+| `Num_cop_tasks` | `int` | count | The number of Coprocessor tasks sent by this statement. |
+| `Mem_max` | `int` | bytes | The maximum memory space used during the execution period of a SQL statement. |
+| `Disk_max` | `int` | bytes | The maximum disk space used during the execution period of a SQL statement. |
+| `Write_sql_response_total` | `float` | second | The time consumed for sending the results back to the client by this statement. |
+| `Succ` | `bool` | none | Whether a statement is executed successfully. |
+| `Resource_group` | `string` | none | The resource group that the statement is bound to. Matching is case-insensitive. |
+| `KV_total` | `float` | second | The time spent on all the RPC requests to TiKV or TiFlash by this statement. |
+| `PD_total` | `float` | second | The time spent on all the RPC requests to PD by this statement. |
+| `Process_time` | `float` | second | The total processing time of a SQL statement in TiKV. Because data is sent to TiKV concurrently, this value might exceed `Query_time`. |
+| `Backoff_time` | `float` | second | The waiting time before retrying when a statement encounters errors that require a retry. Common errors include lock conflicts, Region splits, and busy TiKV servers. |
+| `Total_keys` | `uint` | count | The number of keys that Coprocessor has scanned. |
+| `Process_keys` | `uint` | count | The number of keys that Coprocessor has processed. Compared with `Total_keys`, `Process_keys` does not include old versions of MVCC. A large difference between `Process_keys` and `Total_keys` indicates that many old versions exist. |
+| `cop_mvcc_read_amplification` | `float` | ratio | The MVCC read amplification ratio, calculated as `Total_keys / Process_keys`. |
+| `Prewrite_time` | `float` | second | The duration of the first phase (prewrite) of the two-phase transaction commit. |
+| `Commit_time` | `float` | second | The duration of the second phase (commit) of the two-phase transaction commit. |
+| `Write_keys` | `uint` | count | The count of keys that the transaction writes to the Write CF in TiKV. |
+| `Write_size` | `uint` | bytes | The total size of the keys or values to be written when the transaction commits. |
+| `Prewrite_region` | `uint` | count | The number of TiKV Regions involved in the first phase (prewrite) of the two-phase transaction commit. Each Region triggers a remote procedure call. |
+
+## Effective behavior and matching order
+
+- Setting `tidb_slow_log_rules` overwrites the existing rules in the specified scope instead of appending new rules.
+- Setting `tidb_slow_log_rules` to an empty string clears the rules in the specified scope.
+- Multiple rules are combined with `OR`, while multiple field conditions within a single rule are combined with `AND`.
+- If you still want to use SQL execution time as a condition for writing slow query logs, use `Query_time` in the rule and note that the unit is seconds.
+
+
+
+TiDB Self-Managed supports both `SESSION` and `GLOBAL` rules for `tidb_slow_log_rules`.
+
+- If the current session has any applicable rules, such as `SESSION` rules, `GLOBAL` rules for the current `Conn_ID`, or generic `GLOBAL` rules without `Conn_ID`, slow query log output is determined by the rule matching results, and `tidb_slow_log_threshold` is ignored.
+- If the current session has no applicable rules, for example, when both `SESSION` and `GLOBAL` rules are empty or only `GLOBAL` rules that do not match the current `Conn_ID` are configured, slow query logging still depends on `tidb_slow_log_threshold`. The unit of `tidb_slow_log_threshold` is milliseconds.
+- TiDB matches `SESSION` rules first. If none matches, TiDB then matches `GLOBAL` rules for the current `Conn_ID`, followed by generic `GLOBAL` rules without `Conn_ID`.
+- `SHOW VARIABLES LIKE 'tidb_slow_log_rules'` and `SELECT @@SESSION.tidb_slow_log_rules` return the `SESSION` rule text, or an empty string if unset. `SELECT @@GLOBAL.tidb_slow_log_rules` returns the `GLOBAL` rule text.
+
+
+
+
+
+TiDB Cloud Dedicated supports both `SESSION` and `GLOBAL` rules for `tidb_slow_log_rules`.
+
+- If the current session has any applicable rules, such as `SESSION` rules, `GLOBAL` rules for the current `Conn_ID`, or generic `GLOBAL` rules without `Conn_ID`, slow query log output is determined by the rule matching results.
+- If the current session has no applicable rules, for example, when both `SESSION` and `GLOBAL` rules are empty or only `GLOBAL` rules that do not match the current `Conn_ID` are configured, the rules for slow query logging fall back to the default one: SQL queries that take more than 300 milliseconds are considered as slow queries.
+- TiDB matches `SESSION` rules first. If none matches, TiDB then matches `GLOBAL` rules for the current `Conn_ID`, followed by generic `GLOBAL` rules without `Conn_ID`.
+- `SHOW VARIABLES LIKE 'tidb_slow_log_rules'` and `SELECT @@SESSION.tidb_slow_log_rules` return the `SESSION` rule text, or an empty string if unset. `SELECT @@GLOBAL.tidb_slow_log_rules` returns the `GLOBAL` rule text.
+
+
+
+
+
+TiDB Cloud Essential and TiDB Cloud Premium support only `SESSION` rules for `tidb_slow_log_rules`.
+
+- If the current session has any `SESSION` rules, slow query log output is determined by the rule matching results.
+- `SHOW VARIABLES LIKE 'tidb_slow_log_rules'` and `SELECT @@SESSION.tidb_slow_log_rules` return the `SESSION` rule text, or an empty string if unset.
+
+
+
+## Recommendations
+
+- `tidb_slow_log_rules` is designed to replace the single-threshold approach. It supports combinations of multi-dimensional metric conditions, enabling more flexible and fine-grained control over slow query logging.
+
+- In a well-provisioned test environment with 1 TiDB node (16 CPU cores, 48 GiB memory) and 3 TiKV nodes (each with 16 CPU cores and 48 GiB memory), repeated sysbench tests show that performance impact remains small when multi-dimensional slow query log rules generate millions of slow log entries within 30 minutes. However, when the log volume reaches tens of millions, TPS drops significantly and latency increases noticeably. Therefore, if business workload is high or CPU and memory resources are close to their limits, configure `tidb_slow_log_rules` carefully to avoid log flooding caused by overly broad rules. If you need to limit the log output rate, use [`tidb_slow_log_max_per_sec`](/system-variables.md#tidb_slow_log_max_per_sec) to throttle it and reduce the impact on business performance.
diff --git a/identify-slow-queries.md b/identify-slow-queries.md
index e84fb959e1e5f..f070a981b93ab 100644
--- a/identify-slow-queries.md
+++ b/identify-slow-queries.md
@@ -172,132 +172,9 @@ Fields related to storage engines:
- `Storage_from_kv`: introduced in v8.5.5, indicates whether this statement read data from TiKV.
- `Storage_from_mpp`: introduced in v8.5.5, indicates whether this statement read data from TiFlash.
-## Use `tidb_slow_log_rules`
-
-[`tidb_slow_log_rules`](/system-variables.md#tidb_slow_log_rules-new-in-v856) is used to define trigger rules for slow query logs, supporting multi-dimensional metric combinations. It is suitable for "targeted sampling" and "problem reproduction" of slow logs, enabling you to filter target statements based on specific metric combinations.
-
-The triggering behavior of slow query logs depends on the configuration of `tidb_slow_log_rules`:
-
-- If `tidb_slow_log_rules` is not set, slow query log triggering still relies on [`tidb_slow_log_threshold`](/system-variables.md#tidb_slow_log_threshold) (in milliseconds).
-- If `tidb_slow_log_rules` is set, the configured rules take precedence, and [`tidb_slow_log_threshold`](/system-variables.md#tidb_slow_log_threshold) will be ignored.
-
-For more information about meanings, diagnostic value, and background information of each field, see the [Fields description](#fields-description).
-
-### Unified rule syntax and type constraints
-
-- Rule capacity and separation: `SESSION` and `GLOBAL` each support a maximum of 10 rules. A single session can have up to 20 active rules. Rules are separated by `;`.
-- Condition format: each condition uses the format `field_name:value`. Multiple conditions within a single rule are separated by `,`.
-- Field and scope: field names are case-insensitive (underscores and other characters are preserved). `SESSION` rules do not support `Conn_ID`. Only `GLOBAL` rules support `Conn_ID`.
-- Matching semantics:
- - Numeric fields are matched using `>=`. String and boolean fields are matched using equality (`=`).
- - Matching for `DB` and `Resource_group` is case-insensitive.
- - Explicit operators such as `>`, `<`, and `!=` are not supported.
-
-Type constraints are as follows:
-
-- Numeric types (`int64`, `uint64`, `float64`) uniformly require `>= 0`. Negative values will result in a parsing error.
- - `int64`: the maximum value is `2^63-1`.
- - `uint64`: the maximum value is `2^64-1`.
- - `float64`: the general upper limit is approximately `1.79e308`. Currently, parsing is done using Go's `ParseFloat`. While `NaN`/`Inf` can be parsed, they might lead to rules that are always true or always false. It is not recommended to use them.
-- `bool`: supports `true`/`false`, `1`/`0`, and `t`/`f` (case-insensitive).
-- `string`: currently does not support strings containing the separators `,` (condition separator) or `;` (rule separator), even with quotes (single or double). Escaping is not supported.
-- Duplicate fields: if the same field is specified multiple times in a single rule, the last occurrence takes effect.
-
-### Supported fields
-
-For detailed field descriptions, diagnostic meanings, and background information, see the [field descriptions in `identify-slow-queries`](/identify-slow-queries.md#fields-description).
-
-Unless otherwise noted, the fields in the following table follow the general matching and type rules described in [Unified rule syntax and type constraints](#unified-rule-syntax-and-type-constraints). This table lists only the currently supported field names, types, units, and a few rule-specific notes. It does not repeat each field's semantic meaning.
-
-| Field name | Type | Unit | Notes |
-| -------------------------------------- | -------- | ------ | ------------------------------ |
-| `Conn_ID` | `uint` | count | Supported only in `GLOBAL` rules |
-| `Session_alias` | `string` | none | - |
-| `DB` | `string` | none | Case-insensitive when matched |
-| `Exec_retry_count` | `uint` | count | - |
-| `Query_time` | `float` | second | - |
-| `Parse_time` | `float` | second | - |
-| `Compile_time` | `float` | second | - |
-| `Rewrite_time` | `float` | second | - |
-| `Optimize_time` | `float` | second | - |
-| `Wait_TS` | `float` | second | - |
-| `Is_internal` | `bool` | none | - |
-| `Digest` | `string` | none | - |
-| `Plan_digest` | `string` | none | - |
-| `Num_cop_tasks` | `int` | count | - |
-| `Mem_max` | `int` | bytes | - |
-| `Disk_max` | `int` | bytes | - |
-| `Write_sql_response_total` | `float` | second | - |
-| `Succ` | `bool` | none | - |
-| `Resource_group` | `string` | none | Case-insensitive when matched |
-| `KV_total` | `float` | second | - |
-| `PD_total` | `float` | second | - |
-| `Unpacked_bytes_sent_tikv_total` | `int` | bytes | - |
-| `Unpacked_bytes_received_tikv_total` | `int` | bytes | - |
-| `Unpacked_bytes_sent_tikv_cross_zone` | `int` | bytes | - |
-| `Unpacked_bytes_received_tikv_cross_zone` | `int` | bytes | - |
-| `Unpacked_bytes_sent_tiflash_total` | `int` | bytes | - |
-| `Unpacked_bytes_received_tiflash_total` | `int` | bytes | - |
-| `Unpacked_bytes_sent_tiflash_cross_zone` | `int` | bytes | - |
-| `Unpacked_bytes_received_tiflash_cross_zone` | `int` | bytes | - |
-| `Process_time` | `float` | second | - |
-| `Backoff_time` | `float` | second | - |
-| `Total_keys` | `uint` | count | - |
-| `Process_keys` | `uint` | count | - |
-| `cop_mvcc_read_amplification` | `float` | ratio | Ratio value (`Total_keys / Process_keys`) |
-| `Prewrite_time` | `float` | second | - |
-| `Commit_time` | `float` | second | - |
-| `Write_keys` | `uint` | count | - |
-| `Write_size` | `uint` | bytes | - |
-| `Prewrite_region` | `uint` | count | - |
-
-### Effective behavior and matching order
-
-- Rule update behavior: every execution of `SET [SESSION|GLOBAL] tidb_slow_log_rules = '...'` overwrites the existing rules in that scope instead of appending to them.
-- Rule clearing behavior: `SET [SESSION|GLOBAL] tidb_slow_log_rules = ''` clears the rules in the corresponding scope.
-- If the current session has any applicable `tidb_slow_log_rules`, such as `SESSION` rules, `GLOBAL` rules for the current `Conn_ID`, or generic global rules without `Conn_ID`, the output of slow query logs is determined by rule matching results, and `tidb_slow_log_threshold` is no longer used.
-- If the current session has no applicable rules, for example when both `SESSION` and `GLOBAL` rules are empty, or only `GLOBAL` rules that do not match the current `Conn_ID` are configured, slow query logging still depends on `tidb_slow_log_threshold`. Note that the unit is milliseconds.
-- If you still want to use SQL execution time as a condition for writing slow logs, use `Query_time` in the rule and note that the unit is seconds.
-- Rule matching logic:
- - Multiple rules are combined with `OR`, while multiple field conditions within a single rule are combined with `AND`.
- - `SESSION`-scope rules are matched first. If none matches, TiDB then matches `GLOBAL` rules for the current `Conn_ID`, followed by generic `GLOBAL` rules without `Conn_ID`.
-- `SHOW VARIABLES LIKE 'tidb_slow_log_rules'` and `SELECT @@SESSION.tidb_slow_log_rules` return the `SESSION` rule text, or an empty string if unset. `SELECT @@GLOBAL.tidb_slow_log_rules` returns the `GLOBAL` rule text.
-
-### Examples
-
-- Standard format (`SESSION` scope):
-
- ```sql
- SET SESSION tidb_slow_log_rules = 'Query_time: 0.5, Is_internal: false';
- ```
-
-- Invalid format (`SESSION` scope does not support `Conn_ID`):
-
- ```sql
- SET SESSION tidb_slow_log_rules = 'Conn_ID: 12, Query_time: 0.5, Is_internal: false';
- ```
-
-- Global rule (applies to all connections):
-
- ```sql
- SET GLOBAL tidb_slow_log_rules = 'Query_time: 0.5, Is_internal: false';
- ```
-
-- Global rules for specific connections (applied separately to the two connections `Conn_ID:11` and `Conn_ID:12`):
-
- ```sql
- SET GLOBAL tidb_slow_log_rules = 'Conn_ID: 11, Query_time: 0.5, Is_internal: false; Conn_ID: 12, Query_time: 0.6, Process_time: 0.3, DB: db1';
- ```
-
-### Recommendations
-
-- `tidb_slow_log_rules` is designed to replace the single-threshold approach. It supports combinations of multi-dimensional metric conditions, enabling more flexible and fine-grained control over slow query logging.
-
-- In a well-provisioned test environment with 1 TiDB node (16 CPU cores, 48 GiB memory) and 3 TiKV nodes (each with 16 CPU cores and 48 GiB memory), repeated sysbench tests show that performance impact remains small when multi-dimensional slow query log rules generate millions of slow log entries within 30 minutes. However, when the log volume reaches tens of millions, TPS drops significantly and latency increases noticeably. Therefore, if business workload is high or CPU and memory resources are close to their limits, configure `tidb_slow_log_rules` carefully to avoid log flooding caused by overly broad rules. If you need to limit the log output rate, use [`tidb_slow_log_max_per_sec`](/system-variables.md#tidb_slow_log_max_per_sec-new-in-v856) to throttle it and reduce the impact on business performance.
-
## Related system variables
-* [`tidb_slow_log_rules`](/system-variables.md#tidb_slow_log_rules-new-in-v856): see [`tidb_slow_log_rules` recommendations](#recommendations)
+* [`tidb_slow_log_rules`](/system-variables.md#tidb_slow_log_rules): defines the trigger rules for slow query logs. For more information, see [Configure Trigger Rules for Slow Queries](/config-slow-query-trigger-rules.md).
* [`tidb_slow_log_threshold`](/system-variables.md#tidb_slow_log_threshold): sets the threshold for slow query logging. SQL statements whose execution time exceeds this threshold are recorded in the slow query log. The default value is `300ms` (milliseconds).
@@ -305,7 +182,7 @@ Unless otherwise noted, the fields in the following table follow the general mat
>
> Time-related fields in `tidb_slow_log_rules`, such as `Query_time` and `Process_time`, use seconds as the unit and can include decimals, while [`tidb_slow_log_threshold`](/system-variables.md#tidb_slow_log_threshold) uses milliseconds.
-* [`tidb_slow_log_max_per_sec`](/system-variables.md#tidb_slow_log_max_per_sec-new-in-v856): sets the maximum number of slow query log entries that can be written per second. The default value is `0`. This variable is introduced in v8.5.6.
+* [`tidb_slow_log_max_per_sec`](/system-variables.md#tidb_slow_log_max_per_sec): sets the maximum number of slow query log entries that can be written per second. The default value is `0`. This variable is introduced in v8.5.6.
* A value of `0` means there is no limit on the number of slow query log entries written per second.
* A value greater than `0` means TiDB writes at most the specified number of slow query log entries per second. Any excess log entries are discarded and not written to the slow query log file.
* It is recommended to set this variable after enabling `tidb_slow_log_rules` to prevent rule-based slow query logging from being triggered too frequently.
diff --git a/releases/release-8.5.6.md b/releases/release-8.5.6.md
index 2690f6fdf4db9..e218c4076b086 100644
--- a/releases/release-8.5.6.md
+++ b/releases/release-8.5.6.md
@@ -40,7 +40,7 @@ Quick access: [Quick start](https://docs.pingcap.com/tidb/v8.5/quick-start-with-
Before v8.5.6, the main way to identify slow queries in TiDB is to set the [`tidb_slow_log_threshold`](https://docs.pingcap.com/tidb/v8.5/system-variables#tidb_slow_log_threshold) system variable. This mechanism provides only coarse-grained control over slow query log triggering because it applies globally at the instance level and does not support fine-grained control at the session or SQL level. In addition, it supports only one trigger condition, execution time (`Query_time`), which cannot meet the need to capture slow query logs more precisely in complex scenarios.
- Starting from v8.5.6, TiDB enhances slow query log control. You can use the [`tidb_slow_log_rules`](https://docs.pingcap.com/tidb/v8.5/system-variables#tidb_slow_log_rules-new-in-v856) system variable to define multi-dimensional slow query log output rules at the instance, session, and SQL levels, based on conditions such as `Query_time`, `Digest`, `Mem_max`, and `KV_total`. You can use [`tidb_slow_log_max_per_sec`](https://docs.pingcap.com/tidb/v8.5/system-variables#tidb_slow_log_max_per_sec-new-in-v856) to limit the number of log entries written per second, and use the [`WRITE_SLOW_LOG`](https://docs.pingcap.com/tidb/v8.5/optimizer-hints) hint to force slow query logging for specific SQL statements. This enables more flexible and fine-grained control over slow query logs.
+ Starting from v8.5.6, TiDB enhances slow query log control. You can use the [`tidb_slow_log_rules`](https://docs.pingcap.com/tidb/v8.5/system-variables#tidb_slow_log_rules) system variable to define multi-dimensional slow query log output rules at the instance, session, and SQL levels, based on conditions such as `Query_time`, `Digest`, `Mem_max`, and `KV_total`. You can use [`tidb_slow_log_max_per_sec`](https://docs.pingcap.com/tidb/v8.5/system-variables#tidb_slow_log_max_per_sec) to limit the number of log entries written per second, and use the [`WRITE_SLOW_LOG`](https://docs.pingcap.com/tidb/v8.5/optimizer-hints) hint to force slow query logging for specific SQL statements. This enables more flexible and fine-grained control over slow query logs.
For more information, see [documentation](https://docs.pingcap.com/tidb/v8.5/identify-slow-queries).
@@ -99,8 +99,8 @@ For TiDB clusters newly deployed in v8.5.5 (that is, not upgraded from versions
| [`tidb_foreign_key_check_in_shared_lock`](https://docs.pingcap.com/tidb/v8.5/system-variables#tidb_foreign_key_check_in_shared_lock-new-in-v856) | Newly added | Controls whether foreign key checks in pessimistic transactions use shared locks instead of exclusive locks on rows in the parent table. The default value is `OFF`, which means TiDB uses exclusive locks by default. |
| [`tidb_max_dist_task_nodes`](https://docs.pingcap.com/tidb/v8.5/system-variables#tidb_max_dist_task_nodes-new-in-v856) | Newly added | Defines the maximum number of TiDB nodes that the Distributed eXecution Framework (DXF) tasks can use. The default value is `-1`, which indicates that automatic mode is enabled. In automatic mode, TiDB dynamically calculates the value as `min(3, tikv_nodes / 3)`, where `tikv_nodes` represents the number of TiKV nodes in the cluster. |
| [`tidb_opt_join_reorder_through_sel`](https://docs.pingcap.com/tidb/v8.5/system-variables#tidb_opt_join_reorder_through_sel-new-in-v856) | Newly added | Improves join reorder optimization for certain multi-table join queries. If you set it to `ON` and safety conditions are met, the optimizer evaluates `Selection` conditions between consecutive join operators together with join order candidates. During join tree reconstruction, the optimizer pushes these conditions down to more appropriate positions whenever possible, allowing more tables to participate in join order optimization. |
-| [`tidb_slow_log_max_per_sec`](https://docs.pingcap.com/tidb/v8.5/system-variables#tidb_slow_log_max_per_sec-new-in-v856) | Newly added | Controls the maximum number of slow query log entries that can be written per TiDB node per second.
- A value of `0` (the default) means there is no limit on the number of slow query log entries written per second.
- A value greater than `0` means TiDB writes at most the specified number of slow query log entries per second. Any excess log entries are discarded and not written to the slow query log file.
|
-| [`tidb_slow_log_rules`](https://docs.pingcap.com/tidb/v8.5/system-variables#tidb_slow_log_rules-new-in-v856) | Newly added | Defines the triggering rules for slow query logs. It supports combining multi-dimensional metrics to provide more flexible and fine-grained logging. |
+| [`tidb_slow_log_max_per_sec`](https://docs.pingcap.com/tidb/v8.5/system-variables#tidb_slow_log_max_per_sec) | Newly added | Controls the maximum number of slow query log entries that can be written per TiDB node per second. - A value of `0` (the default) means there is no limit on the number of slow query log entries written per second.
- A value greater than `0` means TiDB writes at most the specified number of slow query log entries per second. Any excess log entries are discarded and not written to the slow query log file.
|
+| [`tidb_slow_log_rules`](https://docs.pingcap.com/tidb/v8.5/system-variables#tidb_slow_log_rules) | Newly added | Defines the triggering rules for slow query logs. It supports combining multi-dimensional metrics to provide more flexible and fine-grained logging. |
### Configuration parameters
diff --git a/system-variables.md b/system-variables.md
index c738522eb18b2..a0b7046ec5c24 100644
--- a/system-variables.md
+++ b/system-variables.md
@@ -5968,7 +5968,11 @@ Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> If the character check is skipped, TiDB might fail to detect invalid UTF-8 characters written by the application, cause decoding errors when `ANALYZE` is executed, and introduce other unknown encoding issues. If your application cannot guarantee the validity of the written string, it is not recommended to skip the character check.
-### tidb_slow_log_max_per_sec New in v8.5.6
+### tidb_slow_log_max_per_sec New in v8.5.6 and CLOUD.202603.1 {#tidb_slow_log_max_per_sec}
+
+>**Note:**
+>
+> This variable is read-only for TiDB Cloud.
- Scope: GLOBAL
- Persists to cluster: Yes
@@ -5979,22 +5983,39 @@ Query OK, 0 rows affected, 1 warning (0.00 sec)
- This variable controls the maximum number of slow query log entries that can be written per TiDB node per second.
- A value of `0` means there is no limit on the number of slow query log entries written per second.
- A value greater than `0` means TiDB writes at most the specified number of slow query log entries per second. Any excess log entries are discarded and not written to the slow query log file.
-- This variable is often used with [`tidb_slow_log_rules`](#tidb_slow_log_rules-new-in-v856) to prevent excessive slow query logs from being generated under high-workload conditions.
+- This variable is often used with [`tidb_slow_log_rules`](#tidb_slow_log_rules) to prevent excessive slow query logs from being generated under high-workload conditions.
-### tidb_slow_log_rules New in v8.5.6
+### tidb_slow_log_rules New in v8.5.6 and CLOUD.202603.1 {#tidb_slow_log_rules}
-- Scope: SESSION | GLOBAL
+>**Note:**
+>
+> This variable is not supported on TiDB Cloud Starter.
+
+- Scope
+ - TiDB Self-Managed and TiDB Cloud Dedicated: SESSION | GLOBAL
+ - TiDB Cloud Essential and Premium: SESSION
- Persists to cluster: Yes
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No
- Default value: ""
- Type: String
- This variable defines the triggering rules for slow query logs. It supports combining multi-dimensional metrics to provide more flexible and fine-grained logging.
-- For more information about how to use this system variable, see [Use `tidb_slow_log_rules`](/identify-slow-queries.md#use-tidb_slow_log_rules).
+- For more information about how to use this system variable, see [Configure Trigger Rules for Slow Queries](/config-slow-query-trigger-rules.md).
+
+
> **Tip:**
>
-> - When enabling `tidb_slow_log_rules` in a production environment, it is recommended to also configure [`tidb_slow_log_max_per_sec`](#tidb_slow_log_max_per_sec-new-in-v856) to avoid excessively frequent slow query log printing.
-> - It is recommended to start with stricter conditions and gradually relax them based on troubleshooting needs. For more information on performance impact, see [Recommendations](/identify-slow-queries.md#recommendations).
+> - When enabling `tidb_slow_log_rules` in a production environment, it is recommended to also configure [`tidb_slow_log_max_per_sec`](#tidb_slow_log_max_per_sec) to avoid excessively frequent slow query log printing.
+> - It is recommended to start with stricter conditions and gradually relax them based on troubleshooting needs. For more information on performance impact, see [Recommendations](/config-slow-query-trigger-rules.md#recommendations).
+
+
+
+
+> **Tip:**
+>
+> It is recommended to start with stricter conditions and gradually relax them based on troubleshooting needs. For more information on performance impact, see [Recommendations](/config-slow-query-trigger-rules.md#recommendations).
+
+
### tidb_slow_log_threshold
diff --git a/tidb-cloud/tune-performance.md b/tidb-cloud/tune-performance.md
index 8c07de956eb46..422c242885f41 100644
--- a/tidb-cloud/tune-performance.md
+++ b/tidb-cloud/tune-performance.md
@@ -46,6 +46,14 @@ TiDB Cloud provides [Slow Query](#slow-query) and [Statement Analysis](#statemen
By default, SQL queries that take more than 300 milliseconds are considered as slow queries.
+
+
+> **Note:**
+>
+> You can also configure trigger rules for slow queries to filter target statements based on specific metric combinations. For more information, see [Configure Trigger Rules for Slow Queries](/config-slow-query-trigger-rules.md).
+
+
+
To view slow queries in a {{{ .starter }}} instance{{{ .essential }}} instance{{{ .premium }}} instance{{{ .dedicated }}} cluster, perform the following steps:
1. [Navigate to the **Diagnosis** page](#view-the-diagnosis-page).