From 00d4b8f5a64fbc37fe75ef0afd70e69898cffd69 Mon Sep 17 00:00:00 2001 From: 0xPoe Date: Mon, 20 Oct 2025 10:37:13 +0200 Subject: [PATCH 01/25] fix: tidb_index_serial_scan_concurrency fix: v8.1 fix: v8.5 fix: tidb_analyze_distsql_scan_concurrency fix: tidb_index_serial_scan_concurrency fix: fix: 8.1 fix: 8.5 fix: update links fix: update fix fix: typo fix: update fix: default value fix: update fix: update fix: update fix: update --- best-practices/tidb-best-practices.md | 2 +- .../sql-statement-show-variables.md | 2 +- statistics.md | 16 +++++----- system-variables.md | 30 ++++++++++++------- ...v8.1-performance-benchmarking-with-tpcc.md | 4 +-- ...v8.5-performance-benchmarking-with-tpcc.md | 4 +-- troubleshoot-tidb-oom.md | 3 +- 7 files changed, 33 insertions(+), 28 deletions(-) diff --git a/best-practices/tidb-best-practices.md b/best-practices/tidb-best-practices.md index 7630146c13ac7..676ee76929823 100644 --- a/best-practices/tidb-best-practices.md +++ b/best-practices/tidb-best-practices.md @@ -130,7 +130,7 @@ Lots of MySQL experience is also applicable to TiDB. It is noted that TiDB has i * Ensure the order of results through indexes - You can use indexes to filter or sort data. Firstly, get row IDs according to the index order. Then, return the row content according to the return order of row IDs. In this way, the returned results are ordered according to the index column. It has been mentioned earlier that the model of scanning index and getting row is parallel + pipeline. If the row is returned according to the index order, a high concurrency between two queries does not reduce latency. Thus, the concurrency is low by default, but it can be modified through the [`tidb_index_serial_scan_concurrency`](/system-variables.md#tidb_index_serial_scan_concurrency) variable. + You can use indexes to filter or sort data. Firstly, get row IDs according to the index order. Then, return the row content according to the return order of row IDs. In this way, the returned results are ordered according to the index column. It has been mentioned earlier that the model of scanning index and getting row is parallel + pipeline. If the row is returned according to the index order, a high concurrency between two queries does not reduce latency. Thus, the concurrency is low by default, but you can increase it by adjusting [`tidb_executor_concurrency`](/system-variables.md#tidb_executor_concurrency-new-in-v50). * Reverse index scan diff --git a/sql-statements/sql-statement-show-variables.md b/sql-statements/sql-statement-show-variables.md index 2d339bb9615ef..3e9f3178f2bdd 100644 --- a/sql-statements/sql-statement-show-variables.md +++ b/sql-statements/sql-statement-show-variables.md @@ -78,4 +78,4 @@ The `SHOW [GLOBAL|SESSION] VARIABLES` statement in TiDB is fully compatible with ## See also -* [`SET [GLOBAL|SESSION]`](/sql-statements/sql-statement-set-variable.md) \ No newline at end of file +* [`SET [GLOBAL|SESSION]`](/sql-statements/sql-statement-set-variable.md) diff --git a/statistics.md b/statistics.md index efb7de1a65db8..4b43abbe2877a 100644 --- a/statistics.md +++ b/statistics.md @@ -756,23 +756,21 @@ The relationships of the relevant system variables are shown below: #### `tidb_build_stats_concurrency` -When you run the `ANALYZE` statement, the task is divided into multiple small tasks. Each task only works on statistics of one column or index. You can use the [`tidb_build_stats_concurrency`](/system-variables.md#tidb_build_stats_concurrency) variable to control the number of simultaneous small tasks. The default value is `2`. The default value is `4` for v7.4.0 and earlier versions. +Used to control the concurrency of table or partition analysis — for example, how many partition or table tasks can be processed simultaneously. The default value is `2`. The default value is `4` for v7.4.0 and earlier versions. #### `tidb_build_sampling_stats_concurrency` -When analyzing ordinary columns, you can use [`tidb_build_sampling_stats_concurrency`](/system-variables.md#tidb_build_sampling_stats_concurrency-new-in-v750) to control the concurrency of executing sampling tasks. The default value is `2`. +1. Used to control the concurrency level for merging samples collected from different regions. +2. Used to control the concurrency for special indexes (such as indexes on generated virtual columns), for example, how many special indexes can collect statistics simultaneously. The default value is `2`. #### `tidb_analyze_partition_concurrency` -When running the `ANALYZE` statement, you can use [`tidb_analyze_partition_concurrency`](/system-variables.md#tidb_analyze_partition_concurrency) to control the concurrency of reading and writing statistics for a partitioned table. The default value is `2`. The default value is `1` for v7.4.0 and earlier versions. +Used to control the concurrency for saving analyze results (writing TopN and histograms to system tables). The default value is `2`. The default value is `1` for v7.4.0 and earlier versions. -#### `tidb_distsql_scan_concurrency` +#### `tidb_analyze_distsql_scan_concurrency` -When you analyze regular columns, you can use the [`tidb_distsql_scan_concurrency`](/system-variables.md#tidb_distsql_scan_concurrency) variable to control the number of Regions to be read at one time. The default value is `15`. Note that changing the value will affect query performance. Adjust the value carefully. - -#### `tidb_index_serial_scan_concurrency` - -When you analyze index columns, you can use the [`tidb_index_serial_scan_concurrency`](/system-variables.md#tidb_index_serial_scan_concurrency) variable to control the number of Regions to be read at one time. The default value is `1`. Note that changing the value will affect query performance. Adjust the value carefully. +1. Used to control the concurrency of scanning TiKV regions. +2. Used to control the concurrency of scanning regions for special indexes (indexes generated from virtual columns). The default value is `4`. ## See also diff --git a/system-variables.md b/system-variables.md index e189bb11874a2..d67c0bc5feccb 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1170,13 +1170,19 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a ### tidb_analyze_distsql_scan_concurrency New in v7.6.0 +> **Note:** +> +> Before v7.6.0, it controlled by the variable `tidb_distsql_scan_concurrency`. +> So please consider change the value of `tidb_distsql_scan_concurrency` if you want to adjust the concurrency of scanning TiKV regions in versions earlier than v7.6.0. + - Scope: SESSION | GLOBAL - Persists to cluster: Yes - Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No - Type: Integer - Default value: `4` - Range: `[0, 4294967295]`. In versions earlier than v8.2.0, the minimum value is `1`. When you set it to `0`, it adaptively adjusts the concurrency based on the cluster size. -- This variable is used to set the concurrency of the `scan` operation when executing the `ANALYZE` operation. +- Used to control the concurrency of scanning TiKV regions. +- Used to control the concurrency of scanning regions for special indexes (indexes generated from virtual columns). ### tidb_analyze_partition_concurrency @@ -1185,7 +1191,7 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a - Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No - Default value: `2`. The default value is `1` for v7.4.0 and earlier versions. - Range: `[1, 128]`. Before v8.4.0, the value range is `[1, 18446744073709551615]`. -- This variable specifies the concurrency for writing collected statistics when TiDB analyzes a partitioned table. +- For manual/auto analyze: used to control the concurrency for saving analyze results (writing TopN and histograms to system tables). ### tidb_analyze_version New in v5.1.0 @@ -1229,7 +1235,7 @@ mysql> SELECT @@tidb_analyze_skip_column_types; +----------------------------------+ | @@tidb_analyze_skip_column_types | +----------------------------------+ -| json,blob,mediumblob,longblob | +| json,blob,mediumblob,longblob,text,mediumtext,longtext | +----------------------------------+ 1 row in set (0.00 sec) @@ -1329,7 +1335,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Type: Integer - Default value: `2` - Range: `[1, 256]` -- This variable is used to set the concurrency of executing the automatic update of statistics. +- For auto analyze: used to control the concurrency of table or partition analysis — for example, how many partition or table tasks can be processed simultaneously. - Starting from v8.5.7 and v9.0.0, the default value of this variable changes from `1` to `2`. If your cluster is upgraded from an earlier version, the value of this variable remains unchanged after the upgrade. ### tidb_backoff_lock_fast @@ -1443,8 +1449,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Default value: `2`. The default value is `4` for v7.4.0 and earlier versions. - Range: `[1, 256]` - Unit: Threads -- This variable is used to set the concurrency of executing the `ANALYZE` statement. -- When the variable is set to a larger value, the execution performance of other queries is affected. +- For manual analyze: used to control the concurrency of table or partition analysis — for example, how many partition or table tasks can be processed simultaneously. ### tidb_build_sampling_stats_concurrency New in v7.5.0 @@ -1455,8 +1460,8 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Unit: Threads - Default value: `2` - Range: `[1, 256]` -- This variable is used to set the sampling concurrency in the `ANALYZE` process. -- When the variable is set to a larger value, the execution performance of other queries is affected. +- Used to control the concurrency level for merging samples collected from different regions. +- Used to control the concurrency for special indexes (such as indexes on generated virtual columns), for example, how many indexes can collect statistics simultaneously. ### tidb_capture_plan_baselines New in v4.0 @@ -3712,6 +3717,10 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified ### tidb_index_serial_scan_concurrency +> **Warning:** +> +> This variable is deprecated and cannot be modified. Sequential index scans now follow [`tidb_executor_concurrency`](#tidb_executor_concurrency-new-in-v50), and [`ANALYZE TABLE`](/sql-statements/sql-statement-analyze-table.md) uses [`tidb_analyze_distsql_scan_concurrency`](#tidb_analyze_distsql_scan_concurrency-new-in-v760) to control index read concurrency. + - Scope: SESSION | GLOBAL - Persists to cluster: Yes - Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes @@ -3719,8 +3728,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Default value: `1` - Range: `[1, 256]` - Unit: Threads -- This variable is used to set the concurrency of the `serial scan` operation. -- Use a bigger value in OLAP scenarios, and a smaller value in OLTP scenarios. +- This variable remains only for backward compatibility. Adjust [`tidb_executor_concurrency`](#tidb_executor_concurrency-new-in-v50) to affect sequential index scans, or [`tidb_analyze_distsql_scan_concurrency`](#tidb_analyze_distsql_scan_concurrency-new-in-v760) to tune index statistics collection. ### tidb_init_chunk_size @@ -4305,7 +4313,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Persists to cluster: Yes - Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No - Default value: `1` -- This variable specifies the concurrency of merging statistics for a partitioned table when TiDB analyzes the partitioned table. +- Used to control the concurrency for merging TopN results of partitioned tables. ### tidb_enable_async_merge_global_stats New in v7.5.0 diff --git a/tidb-cloud/v8.1-performance-benchmarking-with-tpcc.md b/tidb-cloud/v8.1-performance-benchmarking-with-tpcc.md index 8aad399883823..79e74aec086dd 100644 --- a/tidb-cloud/v8.1-performance-benchmarking-with-tpcc.md +++ b/tidb-cloud/v8.1-performance-benchmarking-with-tpcc.md @@ -96,8 +96,8 @@ This section introduces how to perform the TPC-C performance test step by step. ```sql SET tidb_build_stats_concurrency=16; - SET tidb_distsql_scan_concurrency=16; - SET tidb_index_serial_scan_concurrency=16; + SET tidb_build_sampling_stats_concurrency = 16; + SET tidb_analyze_distsql_scan_concurrency=16; ``` 5. Run the following `go-tpc tpcc` command to conduct stress tests on the TiDB Cloud Dedicated cluster. For each concurrency, the test takes two hours. diff --git a/tidb-cloud/v8.5-performance-benchmarking-with-tpcc.md b/tidb-cloud/v8.5-performance-benchmarking-with-tpcc.md index 53abd9096c0cb..3bd5bbd2a576a 100644 --- a/tidb-cloud/v8.5-performance-benchmarking-with-tpcc.md +++ b/tidb-cloud/v8.5-performance-benchmarking-with-tpcc.md @@ -96,8 +96,8 @@ This section introduces how to perform the TPC-C performance test step by step. ```sql SET tidb_build_stats_concurrency=16; - SET tidb_distsql_scan_concurrency=16; - SET tidb_index_serial_scan_concurrency=16; + SET tidb_build_sampling_stats_concurrency = 16; + SET tidb_analyze_distsql_scan_concurrency=16; ``` 5. Run the following `go-tpc tpcc` command to conduct stress tests on the TiDB Cloud Dedicated cluster. For each concurrency, the test takes two hours. diff --git a/troubleshoot-tidb-oom.md b/troubleshoot-tidb-oom.md index 1c2f102cd0681..c888f278f5e63 100644 --- a/troubleshoot-tidb-oom.md +++ b/troubleshoot-tidb-oom.md @@ -99,7 +99,6 @@ You can take the following measures to reduce the memory usage of SQL statements - Reduce the number of Regions to be read simultaneously or reduce the concurrency of operators to avoid memory problems caused by high concurrency. The corresponding system variables include: - [`tidb_distsql_scan_concurrency`](/system-variables.md#tidb_distsql_scan_concurrency) - - [`tidb_index_serial_scan_concurrency`](/system-variables.md#tidb_index_serial_scan_concurrency) - [`tidb_executor_concurrency`](/system-variables.md#tidb_executor_concurrency-new-in-v50) - The concurrency of sessions is too high near the time point when the problem occurs. In this case, consider scaling out the TiDB cluster by adding more TiDB nodes. @@ -195,4 +194,4 @@ To locate the root cause of an OOM issue, you need to collect the following info ## See also - [TiDB Memory Control](/configure-memory-usage.md) -- [Tune TiKV Memory Parameter Performance](/tune-tikv-memory-performance.md) \ No newline at end of file +- [Tune TiKV Memory Parameter Performance](/tune-tikv-memory-performance.md) From 9f166dce84c6a2d6363542e02c79fabd82786373 Mon Sep 17 00:00:00 2001 From: Dongpo Liu Date: Mon, 27 Oct 2025 11:07:48 +0100 Subject: [PATCH 02/25] Update system-variables.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index d67c0bc5feccb..ba72d3b8ec4e8 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1172,7 +1172,7 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a > **Note:** > -> Before v7.6.0, it controlled by the variable `tidb_distsql_scan_concurrency`. +> Before v7.6.0, it was controlled by the variable `tidb_distsql_scan_concurrency`. > So please consider change the value of `tidb_distsql_scan_concurrency` if you want to adjust the concurrency of scanning TiKV regions in versions earlier than v7.6.0. - Scope: SESSION | GLOBAL From 219cdcdb0d6e7ba796f53b9f0a0d8563c3ccdcfe Mon Sep 17 00:00:00 2001 From: Dongpo Liu Date: Mon, 27 Oct 2025 11:07:55 +0100 Subject: [PATCH 03/25] Update system-variables.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index ba72d3b8ec4e8..4773b9ee950df 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1173,7 +1173,7 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a > **Note:** > > Before v7.6.0, it was controlled by the variable `tidb_distsql_scan_concurrency`. -> So please consider change the value of `tidb_distsql_scan_concurrency` if you want to adjust the concurrency of scanning TiKV regions in versions earlier than v7.6.0. +> So please consider changing the value of `tidb_distsql_scan_concurrency` if you want to adjust the concurrency of scanning TiKV regions in versions earlier than v7.6.0. - Scope: SESSION | GLOBAL - Persists to cluster: Yes From e94b90fa4a0222b1ecbe137a5f8e9cff081e6efc Mon Sep 17 00:00:00 2001 From: Dongpo Liu Date: Mon, 27 Oct 2025 11:08:02 +0100 Subject: [PATCH 04/25] Update statistics.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- statistics.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/statistics.md b/statistics.md index 4b43abbe2877a..c93029e18950a 100644 --- a/statistics.md +++ b/statistics.md @@ -761,8 +761,9 @@ Used to control the concurrency of table or partition analysis — for example, #### `tidb_build_sampling_stats_concurrency` 1. Used to control the concurrency level for merging samples collected from different regions. -2. Used to control the concurrency for special indexes (such as indexes on generated virtual columns), for example, how many special indexes can collect statistics simultaneously. The default value is `2`. +2. Used to control the concurrency for special indexes (such as indexes on generated virtual columns), for example, how many special indexes can collect statistics simultaneously. +The default value is `2`. #### `tidb_analyze_partition_concurrency` Used to control the concurrency for saving analyze results (writing TopN and histograms to system tables). The default value is `2`. The default value is `1` for v7.4.0 and earlier versions. From 66d78a81c68538d2ee1f12c3bac1ac9707edaa54 Mon Sep 17 00:00:00 2001 From: Dongpo Liu Date: Mon, 27 Oct 2025 11:08:10 +0100 Subject: [PATCH 05/25] Update statistics.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- statistics.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/statistics.md b/statistics.md index c93029e18950a..a0d2b0b6ecbdd 100644 --- a/statistics.md +++ b/statistics.md @@ -771,8 +771,9 @@ Used to control the concurrency for saving analyze results (writing TopN and his #### `tidb_analyze_distsql_scan_concurrency` 1. Used to control the concurrency of scanning TiKV regions. -2. Used to control the concurrency of scanning regions for special indexes (indexes generated from virtual columns). The default value is `4`. +2. Used to control the concurrency of scanning regions for special indexes (indexes generated from virtual columns). +The default value is `4`. ## See also From 2aaf53d5544647c2e2435bfd4d50d4e249f093e2 Mon Sep 17 00:00:00 2001 From: 0xPoe Date: Mon, 27 Oct 2025 11:13:13 +0100 Subject: [PATCH 06/25] fix: update --- statistics.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/statistics.md b/statistics.md index a0d2b0b6ecbdd..c87e1406e1231 100644 --- a/statistics.md +++ b/statistics.md @@ -764,6 +764,7 @@ Used to control the concurrency of table or partition analysis — for example, 2. Used to control the concurrency for special indexes (such as indexes on generated virtual columns), for example, how many special indexes can collect statistics simultaneously. The default value is `2`. + #### `tidb_analyze_partition_concurrency` Used to control the concurrency for saving analyze results (writing TopN and histograms to system tables). The default value is `2`. The default value is `1` for v7.4.0 and earlier versions. @@ -774,6 +775,7 @@ Used to control the concurrency for saving analyze results (writing TopN and his 2. Used to control the concurrency of scanning regions for special indexes (indexes generated from virtual columns). The default value is `4`. + ## See also From f85bb6e06a3297b9ceb92c3c0daa3daa60a1fdd5 Mon Sep 17 00:00:00 2001 From: 0xPoe Date: Mon, 3 Nov 2025 10:07:48 +0100 Subject: [PATCH 07/25] fix: address comments --- statistics.md | 4 ++-- system-variables.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/statistics.md b/statistics.md index c87e1406e1231..df434e01fab87 100644 --- a/statistics.md +++ b/statistics.md @@ -756,12 +756,12 @@ The relationships of the relevant system variables are shown below: #### `tidb_build_stats_concurrency` -Used to control the concurrency of table or partition analysis — for example, how many partition or table tasks can be processed simultaneously. The default value is `2`. The default value is `4` for v7.4.0 and earlier versions. +Used to control the concurrency of table or partition analysis — for example, the number of partitions or table tasks that can be processed simultaneously. The default value is `2`. The default value is `4` for v7.4.0 and earlier versions. #### `tidb_build_sampling_stats_concurrency` 1. Used to control the concurrency level for merging samples collected from different regions. -2. Used to control the concurrency for special indexes (such as indexes on generated virtual columns), for example, how many special indexes can collect statistics simultaneously. +2. Used to control the concurrency for special indexes (such as indexes on generated virtual columns), for example, the number of special indexes that can collect statistics simultaneously. The default value is `2`. diff --git a/system-variables.md b/system-variables.md index 4773b9ee950df..ffa91baeec3e2 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1335,7 +1335,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Type: Integer - Default value: `2` - Range: `[1, 256]` -- For auto analyze: used to control the concurrency of table or partition analysis — for example, how many partition or table tasks can be processed simultaneously. +- For auto analyze: used to control the concurrency of table or partition analysis — for example, the number of partitions or table tasks that can be processed simultaneously. - Starting from v8.5.7 and v9.0.0, the default value of this variable changes from `1` to `2`. If your cluster is upgraded from an earlier version, the value of this variable remains unchanged after the upgrade. ### tidb_backoff_lock_fast @@ -1449,7 +1449,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Default value: `2`. The default value is `4` for v7.4.0 and earlier versions. - Range: `[1, 256]` - Unit: Threads -- For manual analyze: used to control the concurrency of table or partition analysis — for example, how many partition or table tasks can be processed simultaneously. +- For manual analyze: used to control the concurrency of table or partition analysis — for example, the number of partitions or table tasks that can be processed simultaneously. ### tidb_build_sampling_stats_concurrency New in v7.5.0 @@ -1461,7 +1461,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Default value: `2` - Range: `[1, 256]` - Used to control the concurrency level for merging samples collected from different regions. -- Used to control the concurrency for special indexes (such as indexes on generated virtual columns), for example, how many indexes can collect statistics simultaneously. +- Used to control the concurrency for special indexes (such as indexes on generated virtual columns), for example, the number of indexes which can concurrently collect statistics. ### tidb_capture_plan_baselines New in v4.0 From aed0f3ec29a46961a476b07d6b62b4cad0c513df Mon Sep 17 00:00:00 2001 From: 0xPoe Date: Wed, 25 Mar 2026 09:55:33 +0100 Subject: [PATCH 08/25] fix: correct the output Signed-off-by: 0xPoe --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index ffa91baeec3e2..21ebddc92d11f 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1235,7 +1235,7 @@ mysql> SELECT @@tidb_analyze_skip_column_types; +----------------------------------+ | @@tidb_analyze_skip_column_types | +----------------------------------+ -| json,blob,mediumblob,longblob,text,mediumtext,longtext | +| json,blob,mediumblob,longblob,mediumtext,longtext | +----------------------------------+ 1 row in set (0.00 sec) From a1b4f9bb83770094ae37bbc1db0722b224cc3d75 Mon Sep 17 00:00:00 2001 From: Dongpo Liu Date: Tue, 28 Apr 2026 10:40:01 +0200 Subject: [PATCH 09/25] Update system-variables.md Co-authored-by: Grace Cai --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 21ebddc92d11f..6b7497409425e 100644 --- a/system-variables.md +++ b/system-variables.md @@ -3719,7 +3719,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified > **Warning:** > -> This variable is deprecated and cannot be modified. Sequential index scans now follow [`tidb_executor_concurrency`](#tidb_executor_concurrency-new-in-v50), and [`ANALYZE TABLE`](/sql-statements/sql-statement-analyze-table.md) uses [`tidb_analyze_distsql_scan_concurrency`](#tidb_analyze_distsql_scan_concurrency-new-in-v760) to control index read concurrency. +> This variable is deprecated and no longer controls execution behavior. Sequential index scans now follow [`tidb_executor_concurrency`](#tidb_executor_concurrency-new-in-v50), and [`ANALYZE TABLE`](/sql-statements/sql-statement-analyze-table.md) uses [`tidb_analyze_distsql_scan_concurrency`](#tidb_analyze_distsql_scan_concurrency-new-in-v760) to control index read concurrency. - Scope: SESSION | GLOBAL - Persists to cluster: Yes From 644541ffbbe02154c0e19294056edcd0ccd54edf Mon Sep 17 00:00:00 2001 From: Dongpo Liu Date: Tue, 28 Apr 2026 10:40:17 +0200 Subject: [PATCH 10/25] Update statistics.md Co-authored-by: Grace Cai --- statistics.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/statistics.md b/statistics.md index df434e01fab87..8d41649db5eab 100644 --- a/statistics.md +++ b/statistics.md @@ -771,8 +771,10 @@ Used to control the concurrency for saving analyze results (writing TopN and his #### `tidb_analyze_distsql_scan_concurrency` -1. Used to control the concurrency of scanning TiKV regions. -2. Used to control the concurrency of scanning regions for special indexes (indexes generated from virtual columns). +This variable controls the following aspects of `ANALYZE` concurrency: + +- The concurrency of scanning TiKV regions. +- The concurrency of scanning regions for special indexes (indexes generated from virtual columns). The default value is `4`. From 206de7fc8b951a1d7ccacec89f324ba9211eea53 Mon Sep 17 00:00:00 2001 From: Dongpo Liu Date: Tue, 28 Apr 2026 10:40:55 +0200 Subject: [PATCH 11/25] Update system-variables.md Co-authored-by: Grace Cai --- system-variables.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/system-variables.md b/system-variables.md index 6b7497409425e..e1af14c7d5e00 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1172,8 +1172,7 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a > **Note:** > -> Before v7.6.0, it was controlled by the variable `tidb_distsql_scan_concurrency`. -> So please consider changing the value of `tidb_distsql_scan_concurrency` if you want to adjust the concurrency of scanning TiKV regions in versions earlier than v7.6.0. +> In versions earlier than v7.6.0, regular `ANALYZE` region scans are controlled by `tidb_distsql_scan_concurrency`, and index statistics scans are controlled by `tidb_index_serial_scan_concurrency`. Therefore, to adjust the concurrency of scanning TiKV regions for these versions, consider changing the value of `tidb_distsql_scan_concurrency`. - Scope: SESSION | GLOBAL - Persists to cluster: Yes From 769daa2cf3b0b6bccfcfc85eaf7b113c2d95ae50 Mon Sep 17 00:00:00 2001 From: Dongpo Liu Date: Tue, 28 Apr 2026 10:41:11 +0200 Subject: [PATCH 12/25] Update statistics.md Co-authored-by: Grace Cai --- statistics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/statistics.md b/statistics.md index 8d41649db5eab..6bbd515886516 100644 --- a/statistics.md +++ b/statistics.md @@ -756,7 +756,7 @@ The relationships of the relevant system variables are shown below: #### `tidb_build_stats_concurrency` -Used to control the concurrency of table or partition analysis — for example, the number of partitions or table tasks that can be processed simultaneously. The default value is `2`. The default value is `4` for v7.4.0 and earlier versions. +This variable controls the concurrency of table or partition analysis (for example, the number of partitions or table tasks that can be processed simultaneously). The default value is `2`. The default value is `4` for v7.4.0 and earlier versions. #### `tidb_build_sampling_stats_concurrency` From 000273d2e5e2fa2d35d0d7e1b64e0469542d0e43 Mon Sep 17 00:00:00 2001 From: Dongpo Liu Date: Tue, 28 Apr 2026 10:41:26 +0200 Subject: [PATCH 13/25] Update statistics.md Co-authored-by: Grace Cai --- statistics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/statistics.md b/statistics.md index 6bbd515886516..cbdc531f06885 100644 --- a/statistics.md +++ b/statistics.md @@ -767,7 +767,7 @@ The default value is `2`. #### `tidb_analyze_partition_concurrency` -Used to control the concurrency for saving analyze results (writing TopN and histograms to system tables). The default value is `2`. The default value is `1` for v7.4.0 and earlier versions. +This variable controls the concurrency for saving analyze results (writing TopN and histograms to system tables). The default value is `2`. The default value is `1` for v7.4.0 and earlier versions. #### `tidb_analyze_distsql_scan_concurrency` From ba21f783ebda43791aeb4a9f6d2473bb3b9227b6 Mon Sep 17 00:00:00 2001 From: Dongpo Liu Date: Tue, 28 Apr 2026 10:41:37 +0200 Subject: [PATCH 14/25] Update best-practices/tidb-best-practices.md Co-authored-by: Grace Cai --- best-practices/tidb-best-practices.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/best-practices/tidb-best-practices.md b/best-practices/tidb-best-practices.md index 676ee76929823..69118e585d7e2 100644 --- a/best-practices/tidb-best-practices.md +++ b/best-practices/tidb-best-practices.md @@ -130,7 +130,7 @@ Lots of MySQL experience is also applicable to TiDB. It is noted that TiDB has i * Ensure the order of results through indexes - You can use indexes to filter or sort data. Firstly, get row IDs according to the index order. Then, return the row content according to the return order of row IDs. In this way, the returned results are ordered according to the index column. It has been mentioned earlier that the model of scanning index and getting row is parallel + pipeline. If the row is returned according to the index order, a high concurrency between two queries does not reduce latency. Thus, the concurrency is low by default, but you can increase it by adjusting [`tidb_executor_concurrency`](/system-variables.md#tidb_executor_concurrency-new-in-v50). + You can use indexes to filter or sort data. TiDB first gets row IDs according to the index order, and then returns the row content according to the order of those row IDs. In this way, the returned results are ordered according to the index column. It has been mentioned earlier that the model of scanning index and getting row is parallel + pipeline. If the row is returned according to the index order, a high concurrency between two queries does not reduce latency. Thus, the concurrency is low by default, but you can increase it by adjusting [`tidb_executor_concurrency`](/system-variables.md#tidb_executor_concurrency-new-in-v50). * Reverse index scan From aca435a94cd4d229825dd210db9cd23452bcf830 Mon Sep 17 00:00:00 2001 From: Dongpo Liu Date: Tue, 28 Apr 2026 10:41:52 +0200 Subject: [PATCH 15/25] Update system-variables.md Co-authored-by: Grace Cai --- system-variables.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system-variables.md b/system-variables.md index e1af14c7d5e00..1ac7c907f85b6 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1180,8 +1180,9 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a - Type: Integer - Default value: `4` - Range: `[0, 4294967295]`. In versions earlier than v8.2.0, the minimum value is `1`. When you set it to `0`, it adaptively adjusts the concurrency based on the cluster size. -- Used to control the concurrency of scanning TiKV regions. -- Used to control the concurrency of scanning regions for special indexes (indexes generated from virtual columns). +- This variable controls the following aspects of `ANALYZE` concurrency: + - The concurrency of scanning TiKV regions. + - The concurrency of scanning regions for special indexes, such as indexes on generated virtual columns. ### tidb_analyze_partition_concurrency From 2b1cbbd66b0f0eec24468f7383f1f06bf86b2eb3 Mon Sep 17 00:00:00 2001 From: Dongpo Liu Date: Tue, 28 Apr 2026 10:42:08 +0200 Subject: [PATCH 16/25] Update system-variables.md Co-authored-by: Grace Cai --- system-variables.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system-variables.md b/system-variables.md index 1ac7c907f85b6..3cf73231a8068 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1460,8 +1460,9 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Unit: Threads - Default value: `2` - Range: `[1, 256]` -- Used to control the concurrency level for merging samples collected from different regions. -- Used to control the concurrency for special indexes (such as indexes on generated virtual columns), for example, the number of indexes which can concurrently collect statistics. +- This variable controls the following aspects of `ANALYZE` concurrency: + - The concurrency for merging samples collected from different regions. + - The concurrency for special indexes (such as indexes on generated virtual columns), for example, the number of indexes that TiDB can concurrently collect statistics for. ### tidb_capture_plan_baselines New in v4.0 From 422ba38cc1d77e55972468876f5d054bd16098d1 Mon Sep 17 00:00:00 2001 From: Dongpo Liu Date: Tue, 28 Apr 2026 10:42:18 +0200 Subject: [PATCH 17/25] Update statistics.md Co-authored-by: Grace Cai --- statistics.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/statistics.md b/statistics.md index cbdc531f06885..6402e8c4c4711 100644 --- a/statistics.md +++ b/statistics.md @@ -760,8 +760,10 @@ This variable controls the concurrency of table or partition analysis (for examp #### `tidb_build_sampling_stats_concurrency` -1. Used to control the concurrency level for merging samples collected from different regions. -2. Used to control the concurrency for special indexes (such as indexes on generated virtual columns), for example, the number of special indexes that can collect statistics simultaneously. +This variable controls the following aspects of `ANALYZE` concurrency: + +- The concurrency for merging samples collected from different regions. +- The concurrency for special indexes (such as indexes on generated virtual columns), for example, the number of indexes that TiDB can concurrently collect statistics for. The default value is `2`. From cd899d874b07aed6b3eb9852a55ca06c258cdc22 Mon Sep 17 00:00:00 2001 From: Dongpo Liu Date: Tue, 28 Apr 2026 10:42:35 +0200 Subject: [PATCH 18/25] Update system-variables.md Co-authored-by: Grace Cai --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 3cf73231a8068..a4052da6e5e4a 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1191,7 +1191,7 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a - Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No - Default value: `2`. The default value is `1` for v7.4.0 and earlier versions. - Range: `[1, 128]`. Before v8.4.0, the value range is `[1, 18446744073709551615]`. -- For manual/auto analyze: used to control the concurrency for saving analyze results (writing TopN and histograms to system tables). +- For manual and auto analyze, this variable controls the concurrency for saving analyze results, including writing TopN and histograms to system tables. ### tidb_analyze_version New in v5.1.0 From c5de427aec320446018b2087e474f6850c2e9c8a Mon Sep 17 00:00:00 2001 From: Dongpo Liu Date: Tue, 28 Apr 2026 10:42:47 +0200 Subject: [PATCH 19/25] Update system-variables.md Co-authored-by: Grace Cai --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index a4052da6e5e4a..8fe1a538e3a06 100644 --- a/system-variables.md +++ b/system-variables.md @@ -4314,7 +4314,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Persists to cluster: Yes - Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No - Default value: `1` -- Used to control the concurrency for merging TopN results of partitioned tables. +- This variable controls the concurrency for merging TopN results of partitioned tables. ### tidb_enable_async_merge_global_stats New in v7.5.0 From 2588e3cdba419c91583a32353932029480798c63 Mon Sep 17 00:00:00 2001 From: Dongpo Liu Date: Tue, 28 Apr 2026 10:43:08 +0200 Subject: [PATCH 20/25] Update system-variables.md Co-authored-by: Grace Cai --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 8fe1a538e3a06..df18fea31514f 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1335,7 +1335,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Type: Integer - Default value: `2` - Range: `[1, 256]` -- For auto analyze: used to control the concurrency of table or partition analysis — for example, the number of partitions or table tasks that can be processed simultaneously. +- For auto analyze, this variable controls the concurrency of table or partition analysis, for example, the number of partitions or table tasks that can be processed simultaneously. - Starting from v8.5.7 and v9.0.0, the default value of this variable changes from `1` to `2`. If your cluster is upgraded from an earlier version, the value of this variable remains unchanged after the upgrade. ### tidb_backoff_lock_fast From e7b7ef82dcff04353bbab12e16868f21fd022684 Mon Sep 17 00:00:00 2001 From: Dongpo Liu Date: Tue, 28 Apr 2026 10:43:20 +0200 Subject: [PATCH 21/25] Update system-variables.md Co-authored-by: Grace Cai --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index df18fea31514f..809e680ef19cb 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1449,7 +1449,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Default value: `2`. The default value is `4` for v7.4.0 and earlier versions. - Range: `[1, 256]` - Unit: Threads -- For manual analyze: used to control the concurrency of table or partition analysis — for example, the number of partitions or table tasks that can be processed simultaneously. +- For manual analyze, this variable controls the concurrency of table or partition analysis, for example, the number of partitions or table tasks that can be processed simultaneously. ### tidb_build_sampling_stats_concurrency New in v7.5.0 From 0990afdcd67a9ce62dd98d464b492b59c7ff8732 Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Thu, 7 May 2026 18:26:42 +0800 Subject: [PATCH 22/25] minor wording updates --- statistics.md | 4 ++-- system-variables.md | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/statistics.md b/statistics.md index 6402e8c4c4711..c05c9ebd25a06 100644 --- a/statistics.md +++ b/statistics.md @@ -756,7 +756,7 @@ The relationships of the relevant system variables are shown below: #### `tidb_build_stats_concurrency` -This variable controls the concurrency of table or partition analysis (for example, the number of partitions or table tasks that can be processed simultaneously). The default value is `2`. The default value is `4` for v7.4.0 and earlier versions. +This variable controls the concurrency for building statistics during manual `ANALYZE`, such as the number of table or partition analysis tasks that can be processed simultaneously. The default value is `2`. The default value is `4` for v7.4.0 and earlier versions. #### `tidb_build_sampling_stats_concurrency` @@ -769,7 +769,7 @@ The default value is `2`. #### `tidb_analyze_partition_concurrency` -This variable controls the concurrency for saving analyze results (writing TopN and histograms to system tables). The default value is `2`. The default value is `1` for v7.4.0 and earlier versions. +This variable controls the concurrency for saving `ANALYZE` results (writing TopN and histograms to system tables). The default value is `2`. The default value is `1` for v7.4.0 and earlier versions. #### `tidb_analyze_distsql_scan_concurrency` diff --git a/system-variables.md b/system-variables.md index 809e680ef19cb..c9d582b6c8616 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1181,8 +1181,8 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a - Default value: `4` - Range: `[0, 4294967295]`. In versions earlier than v8.2.0, the minimum value is `1`. When you set it to `0`, it adaptively adjusts the concurrency based on the cluster size. - This variable controls the following aspects of `ANALYZE` concurrency: - - The concurrency of scanning TiKV regions. - - The concurrency of scanning regions for special indexes, such as indexes on generated virtual columns. + - The concurrency of scanning TiKV Regions. + - The concurrency of scanning Regions for special indexes, such as indexes on generated virtual columns. ### tidb_analyze_partition_concurrency @@ -1191,7 +1191,7 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a - Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No - Default value: `2`. The default value is `1` for v7.4.0 and earlier versions. - Range: `[1, 128]`. Before v8.4.0, the value range is `[1, 18446744073709551615]`. -- For manual and auto analyze, this variable controls the concurrency for saving analyze results, including writing TopN and histograms to system tables. +- For manual and auto `ANALYZE`, this variable controls the concurrency for saving `ANALYZE` results, including writing TopN and histograms to system tables. ### tidb_analyze_version New in v5.1.0 @@ -1335,7 +1335,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Type: Integer - Default value: `2` - Range: `[1, 256]` -- For auto analyze, this variable controls the concurrency of table or partition analysis, for example, the number of partitions or table tasks that can be processed simultaneously. +- This variable controls the concurrency for building statistics during auto `ANALYZE`, such as the number of table or partition analysis tasks that can be processed simultaneously - Starting from v8.5.7 and v9.0.0, the default value of this variable changes from `1` to `2`. If your cluster is upgraded from an earlier version, the value of this variable remains unchanged after the upgrade. ### tidb_backoff_lock_fast @@ -1449,7 +1449,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Default value: `2`. The default value is `4` for v7.4.0 and earlier versions. - Range: `[1, 256]` - Unit: Threads -- For manual analyze, this variable controls the concurrency of table or partition analysis, for example, the number of partitions or table tasks that can be processed simultaneously. +- This variable controls the concurrency for building statistics during manual `ANALYZE`, such as the number of table or partition analysis tasks that can be processed simultaneously. ### tidb_build_sampling_stats_concurrency New in v7.5.0 From f84d7aebb7f1816d05decb5349010c4d943fe630 Mon Sep 17 00:00:00 2001 From: qiancai Date: Tue, 14 Jul 2026 13:51:07 +0800 Subject: [PATCH 23/25] Update sql-statement-show-variables.md --- sql-statements/sql-statement-show-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-show-variables.md b/sql-statements/sql-statement-show-variables.md index 3e9f3178f2bdd..2d339bb9615ef 100644 --- a/sql-statements/sql-statement-show-variables.md +++ b/sql-statements/sql-statement-show-variables.md @@ -78,4 +78,4 @@ The `SHOW [GLOBAL|SESSION] VARIABLES` statement in TiDB is fully compatible with ## See also -* [`SET [GLOBAL|SESSION]`](/sql-statements/sql-statement-set-variable.md) +* [`SET [GLOBAL|SESSION]`](/sql-statements/sql-statement-set-variable.md) \ No newline at end of file From 00a933954ab07f3d059b920821b9c6132c090a52 Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Tue, 14 Jul 2026 14:25:21 +0800 Subject: [PATCH 24/25] region -> Region --- statistics.md | 6 +++--- system-variables.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/statistics.md b/statistics.md index c05c9ebd25a06..11f5abae64c0f 100644 --- a/statistics.md +++ b/statistics.md @@ -762,7 +762,7 @@ This variable controls the concurrency for building statistics during manual `AN This variable controls the following aspects of `ANALYZE` concurrency: -- The concurrency for merging samples collected from different regions. +- The concurrency for merging samples collected from different Regions. - The concurrency for special indexes (such as indexes on generated virtual columns), for example, the number of indexes that TiDB can concurrently collect statistics for. The default value is `2`. @@ -775,8 +775,8 @@ This variable controls the concurrency for saving `ANALYZE` results (writing Top This variable controls the following aspects of `ANALYZE` concurrency: -- The concurrency of scanning TiKV regions. -- The concurrency of scanning regions for special indexes (indexes generated from virtual columns). +- The concurrency of scanning TiKV Regions. +- The concurrency of scanning Regions for special indexes (indexes generated from virtual columns). The default value is `4`. diff --git a/system-variables.md b/system-variables.md index c9d582b6c8616..7c3c9810caed6 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1172,7 +1172,7 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a > **Note:** > -> In versions earlier than v7.6.0, regular `ANALYZE` region scans are controlled by `tidb_distsql_scan_concurrency`, and index statistics scans are controlled by `tidb_index_serial_scan_concurrency`. Therefore, to adjust the concurrency of scanning TiKV regions for these versions, consider changing the value of `tidb_distsql_scan_concurrency`. +> In versions earlier than v7.6.0, regular `ANALYZE` region scans are controlled by `tidb_distsql_scan_concurrency`, and index statistics scans are controlled by `tidb_index_serial_scan_concurrency`. Therefore, to adjust the concurrency of scanning TiKV Regions for these versions, consider changing the value of `tidb_distsql_scan_concurrency`. - Scope: SESSION | GLOBAL - Persists to cluster: Yes @@ -1461,7 +1461,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Default value: `2` - Range: `[1, 256]` - This variable controls the following aspects of `ANALYZE` concurrency: - - The concurrency for merging samples collected from different regions. + - The concurrency for merging samples collected from different Regions. - The concurrency for special indexes (such as indexes on generated virtual columns), for example, the number of indexes that TiDB can concurrently collect statistics for. ### tidb_capture_plan_baselines New in v4.0 From 20feb5313a2713f2fb09066a166731f03cd48d4a Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Tue, 14 Jul 2026 14:38:15 +0800 Subject: [PATCH 25/25] minor wording updates --- statistics.md | 2 +- system-variables.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/statistics.md b/statistics.md index 11f5abae64c0f..e0fc111626094 100644 --- a/statistics.md +++ b/statistics.md @@ -763,7 +763,7 @@ This variable controls the concurrency for building statistics during manual `AN This variable controls the following aspects of `ANALYZE` concurrency: - The concurrency for merging samples collected from different Regions. -- The concurrency for special indexes (such as indexes on generated virtual columns), for example, the number of indexes that TiDB can concurrently collect statistics for. +- The concurrency for collecting statistics on special indexes (such as indexes on generated virtual columns), for example, the number of indexes that TiDB can concurrently collect statistics for. The default value is `2`. diff --git a/system-variables.md b/system-variables.md index 7c3c9810caed6..7048fc9245f63 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1462,7 +1462,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Range: `[1, 256]` - This variable controls the following aspects of `ANALYZE` concurrency: - The concurrency for merging samples collected from different Regions. - - The concurrency for special indexes (such as indexes on generated virtual columns), for example, the number of indexes that TiDB can concurrently collect statistics for. + - The concurrency for collecting statistics on special indexes (such as indexes on generated virtual columns), for example, the number of indexes that TiDB can concurrently collect statistics for. ### tidb_capture_plan_baselines New in v4.0 @@ -3720,7 +3720,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified > **Warning:** > -> This variable is deprecated and no longer controls execution behavior. Sequential index scans now follow [`tidb_executor_concurrency`](#tidb_executor_concurrency-new-in-v50), and [`ANALYZE TABLE`](/sql-statements/sql-statement-analyze-table.md) uses [`tidb_analyze_distsql_scan_concurrency`](#tidb_analyze_distsql_scan_concurrency-new-in-v760) to control index read concurrency. +> This variable is deprecated and no longer controls execution behavior. The concurrency of sequential index scans is now controlled by [`tidb_executor_concurrency`](#tidb_executor_concurrency-new-in-v50), and [`ANALYZE TABLE`](/sql-statements/sql-statement-analyze-table.md) uses [`tidb_analyze_distsql_scan_concurrency`](#tidb_analyze_distsql_scan_concurrency-new-in-v760) to control the concurrency of index statistics scans. - Scope: SESSION | GLOBAL - Persists to cluster: Yes @@ -3729,7 +3729,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Default value: `1` - Range: `[1, 256]` - Unit: Threads -- This variable remains only for backward compatibility. Adjust [`tidb_executor_concurrency`](#tidb_executor_concurrency-new-in-v50) to affect sequential index scans, or [`tidb_analyze_distsql_scan_concurrency`](#tidb_analyze_distsql_scan_concurrency-new-in-v760) to tune index statistics collection. +- This variable remains only for backward compatibility. Use [`tidb_executor_concurrency`](#tidb_executor_concurrency-new-in-v50) to control the concurrency of sequential index scans, or [`tidb_analyze_distsql_scan_concurrency`](#tidb_analyze_distsql_scan_concurrency-new-in-v760) to control the concurrency of index statistics scans. ### tidb_init_chunk_size