From 322d1306ee41f35e039a5368df3b17684231a469 Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 20 Aug 2024 17:01:42 +0800 Subject: [PATCH 1/4] This is an automated cherry-pick of #18366 Signed-off-by: ti-chi-bot --- system-variables.md | 2 +- tidb-configuration-file.md | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/system-variables.md b/system-variables.md index 0ca4b97368c5c..0d6a9bb30f031 100644 --- a/system-variables.md +++ b/system-variables.md @@ -2865,7 +2865,7 @@ Query OK, 0 rows affected, 1 warning (0.00 sec) - Default value: `300` - Range: `[-1, 9223372036854775807]` - Unit: Milliseconds -- This variable is used to output the threshold value of the time consumed by the slow log. When the time consumed by a query is larger than this value, this query is considered as a slow log and its log is output to the slow query log. +- This variable outputs the threshold value of the time consumed by the slow log, and is set to 300 milliseconds by default. When the time consumed by a query is larger than this value, this query is considered as a slow query and its log is output to the slow query log. Note that when the output level of [`log.level`](https://docs.pingcap.com/tidb/dev/tidb-configuration-file#level) is `"debug"`, all queries are recorded in the slow query log, regardless of the setting of this variable. ### tidb_max_tiflash_threads New in v6.1.0 diff --git a/tidb-configuration-file.md b/tidb-configuration-file.md index 8867860c12c01..fcc2ef21cf5f1 100644 --- a/tidb-configuration-file.md +++ b/tidb-configuration-file.md @@ -231,7 +231,12 @@ Configuration items related to log. - Outputs the threshold value of consumed time in the slow log. - Default value: `300` - Unit: Milliseconds +<<<<<<< HEAD - If the value in a query is larger than the default value, it is a slow query and is output to the slow log. +======= +- When the time consumed by a query is larger than this value, this query is considered as a slow query and its log is output to the slow query log. Note that when the output level of [`log.level`](#level) is `"debug"`, all queries are recorded in the slow query log, regardless of the setting of this parameter. +- Since v6.1.0, the threshold value of consumed time in the slow log is specified by the TiDB configuration item [`instance.tidb_slow_log_threshold`](/tidb-configuration-file.md#tidb_slow_log_threshold) or the system variable [`tidb_slow_log_threshold`](/system-variables.md#tidb_slow_log_threshold). `slow-threshold` still takes effect. But if `slow-threshold` and `instance.tidb_slow_log_threshold` are set at the same time, the latter takes effect. +>>>>>>> da5669a158 (Refine slow log description (#18366)) ### `record-plan-in-slow-log` @@ -743,10 +748,11 @@ Configuration items related to read isolation. ### `tidb_slow_log_threshold` -- This configuration is used to output the threshold value of the time consumed by the slow log. When the time consumed by a query is larger than this value, this query is considered as a slow log and its log is output to the slow query log. +- Outputs the threshold value of the time consumed by the slow log. - Default value: `300` - Range: `[-1, 9223372036854775807]` - Unit: Milliseconds +- When the time consumed by a query is larger than this value, this query is considered as a slow query and its log is output to the slow query log. Note that when the output level of [`log.level`](#level) is `"debug"`, all queries are recorded in the slow query log, regardless of the setting of this parameter. - Before v6.1.0, this configuration is set by `slow-threshold`. ### `tidb_expensive_query_time_threshold` From 72c81f366dcc8cf89e6a5a9094306ee9718a1cf2 Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 20 Aug 2024 18:11:52 +0800 Subject: [PATCH 2/4] Update system-variables.md --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 0d6a9bb30f031..d0374844e5432 100644 --- a/system-variables.md +++ b/system-variables.md @@ -2865,7 +2865,7 @@ Query OK, 0 rows affected, 1 warning (0.00 sec) - Default value: `300` - Range: `[-1, 9223372036854775807]` - Unit: Milliseconds -- This variable outputs the threshold value of the time consumed by the slow log, and is set to 300 milliseconds by default. When the time consumed by a query is larger than this value, this query is considered as a slow query and its log is output to the slow query log. Note that when the output level of [`log.level`](https://docs.pingcap.com/tidb/dev/tidb-configuration-file#level) is `"debug"`, all queries are recorded in the slow query log, regardless of the setting of this variable. +- This variable outputs the threshold value of the time consumed by the slow log, and is set to 300 milliseconds by default. When the time consumed by a query is larger than this value, this query is considered as a slow query and its log is output to the slow query log. Note that when the output level of [`log.level`](https://docs.pingcap.com/tidb/v6.1/tidb-configuration-file#level) is `"debug"`, all queries are recorded in the slow query log, regardless of the setting of this variable. ### tidb_max_tiflash_threads New in v6.1.0 From fd0a7fce69ec1789ad0d4234ba0a57f187923151 Mon Sep 17 00:00:00 2001 From: lilin90 Date: Tue, 20 Aug 2024 18:16:19 +0800 Subject: [PATCH 3/4] Update tidb-configuration-file.md --- tidb-configuration-file.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tidb-configuration-file.md b/tidb-configuration-file.md index fcc2ef21cf5f1..a6751af6114d0 100644 --- a/tidb-configuration-file.md +++ b/tidb-configuration-file.md @@ -231,12 +231,8 @@ Configuration items related to log. - Outputs the threshold value of consumed time in the slow log. - Default value: `300` - Unit: Milliseconds -<<<<<<< HEAD -- If the value in a query is larger than the default value, it is a slow query and is output to the slow log. -======= - When the time consumed by a query is larger than this value, this query is considered as a slow query and its log is output to the slow query log. Note that when the output level of [`log.level`](#level) is `"debug"`, all queries are recorded in the slow query log, regardless of the setting of this parameter. - Since v6.1.0, the threshold value of consumed time in the slow log is specified by the TiDB configuration item [`instance.tidb_slow_log_threshold`](/tidb-configuration-file.md#tidb_slow_log_threshold) or the system variable [`tidb_slow_log_threshold`](/system-variables.md#tidb_slow_log_threshold). `slow-threshold` still takes effect. But if `slow-threshold` and `instance.tidb_slow_log_threshold` are set at the same time, the latter takes effect. ->>>>>>> da5669a158 (Refine slow log description (#18366)) ### `record-plan-in-slow-log` From e882c293f4d725fcc98ceadd1bfa62bb8107a548 Mon Sep 17 00:00:00 2001 From: lilin90 Date: Tue, 20 Aug 2024 18:18:40 +0800 Subject: [PATCH 4/4] Update tidb-configuration-file.md --- tidb-configuration-file.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tidb-configuration-file.md b/tidb-configuration-file.md index a6751af6114d0..94329a0c24d5d 100644 --- a/tidb-configuration-file.md +++ b/tidb-configuration-file.md @@ -232,7 +232,7 @@ Configuration items related to log. - Default value: `300` - Unit: Milliseconds - When the time consumed by a query is larger than this value, this query is considered as a slow query and its log is output to the slow query log. Note that when the output level of [`log.level`](#level) is `"debug"`, all queries are recorded in the slow query log, regardless of the setting of this parameter. -- Since v6.1.0, the threshold value of consumed time in the slow log is specified by the TiDB configuration item [`instance.tidb_slow_log_threshold`](/tidb-configuration-file.md#tidb_slow_log_threshold) or the system variable [`tidb_slow_log_threshold`](/system-variables.md#tidb_slow_log_threshold). `slow-threshold` still takes effect. But if `slow-threshold` and `instance.tidb_slow_log_threshold` are set at the same time, the latter takes effect. +- Since v6.1.0, the threshold value of consumed time in the slow log is specified by the TiDB configuration item [`instance.tidb_slow_log_threshold`](#tidb_slow_log_threshold) or the system variable [`tidb_slow_log_threshold`](/system-variables.md#tidb_slow_log_threshold). `slow-threshold` still takes effect. But if `slow-threshold` and `instance.tidb_slow_log_threshold` are set at the same time, the latter takes effect. ### `record-plan-in-slow-log`