You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: best-practices/tidb-best-practices.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,7 +130,7 @@ Lots of MySQL experience is also applicable to TiDB. It is noted that TiDB has i
130
130
131
131
* Ensure the order of results through indexes
132
132
133
-
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.
133
+
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).
Copy file name to clipboardExpand all lines: statistics.md
+7-9Lines changed: 7 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -752,23 +752,21 @@ The relationships of the relevant system variables are shown below:
752
752
753
753
#### `tidb_build_stats_concurrency`
754
754
755
-
When you run the `ANALYZE` statement, the task is divided into multiple small tasks. Each task only works on statistics of one column orindex. 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.
755
+
Used to control the concurrency of table or partition analysis — for example, how many partition ortable tasks can be processed simultaneously. The default value is `2`. The default value is `4` for v7.4.0and earlier versions.
756
756
757
757
#### `tidb_build_sampling_stats_concurrency`
758
758
759
-
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`.
759
+
1. Used to control the concurrency level for merging samples collected from different regions.
760
+
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`.
760
761
761
762
#### `tidb_analyze_partition_concurrency`
762
763
763
-
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.
764
+
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.0and earlier versions.
764
765
765
-
#### `tidb_distsql_scan_concurrency`
766
+
#### `tidb_analyze_distsql_scan_concurrency`
766
767
767
-
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.
768
-
769
-
#### `tidb_index_serial_scan_concurrency`
770
-
771
-
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.
768
+
1. Used to control the concurrency of scanning TiKV regions.
769
+
2. Used to control the concurrency of scanning regions for special indexes (indexes generated from virtual columns). The default value is `4`.
Copy file name to clipboardExpand all lines: system-variables.md
+19-11Lines changed: 19 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1130,13 +1130,19 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a
1130
1130
1131
1131
### tidb_analyze_distsql_scan_concurrency <span class="version-mark">New in v7.6.0</span>
1132
1132
1133
+
> **Note:**
1134
+
>
1135
+
> Before v7.6.0, it controlled by the variable `tidb_distsql_scan_concurrency`.
1136
+
> 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.
1137
+
1133
1138
- Scope: SESSION | GLOBAL
1134
1139
- Persists to cluster: Yes
1135
1140
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No
1136
1141
- Type: Integer
1137
1142
- Default value: `4`
1138
1143
- 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.
1139
-
- This variable is used to set the concurrency of the `scan` operation when executing the `ANALYZE` operation.
1144
+
- Used to control the concurrency of scanning TiKV regions.
1145
+
- Used to control the concurrency of scanning regions for special indexes (indexes generated from virtual columns).
1140
1146
1141
1147
### tidb_analyze_partition_concurrency
1142
1148
@@ -1145,7 +1151,7 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a
1145
1151
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No
1146
1152
- Default value: `2`. The default value is `1` for v7.4.0 and earlier versions.
1147
1153
- Range: `[1, 128]`. Before v8.4.0, the value range is `[1, 18446744073709551615]`.
1148
-
- This variable specifies the concurrency for writing collected statistics when TiDB analyzes a partitioned table.
1154
+
- For manual/auto analyze: used to control the concurrency for saving analyze results (writing TopN and histograms to system tables).
1149
1155
1150
1156
### tidb_analyze_version <span class="version-mark">New in v5.1.0</span>
@@ -1287,7 +1293,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1;
1287
1293
- Type: Integer
1288
1294
- Default value: `1`
1289
1295
- Range: `[1, 256]`
1290
-
-This variable is used to set the concurrency of executing the automatic update of statistics.
1296
+
-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.
1291
1297
1292
1298
### tidb_backoff_lock_fast
1293
1299
@@ -1400,8 +1406,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1;
1400
1406
- Default value: `2`. The default value is `4` for v7.4.0 and earlier versions.
1401
1407
- Range: `[1, 256]`
1402
1408
- Unit: Threads
1403
-
- This variable is used to set the concurrency of executing the `ANALYZE` statement.
1404
-
- When the variable is set to a larger value, the execution performance of other queries is affected.
1409
+
- 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.
1405
1410
1406
1411
### tidb_build_sampling_stats_concurrency <spanclass="version-mark">New in v7.5.0</span>
1407
1412
@@ -1412,8 +1417,8 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1;
1412
1417
- Unit: Threads
1413
1418
- Default value: `2`
1414
1419
- Range: `[1, 256]`
1415
-
-This variable is used to set the sampling concurrency in the `ANALYZE` process.
1416
-
-When the variable is set to a larger value, the execution performance of other queries is affected.
1420
+
-Used to control the concurrency level for merging samples collected from different regions.
1421
+
-Used to control the concurrency for special indexes (such as indexes on generated virtual columns), for example, how many indexes can collect statistics simultaneously.
1417
1422
1418
1423
### tidb_capture_plan_baselines <spanclass="version-mark">New in v4.0</span>
1419
1424
@@ -3506,15 +3511,18 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified
3506
3511
3507
3512
### tidb_index_serial_scan_concurrency
3508
3513
3514
+
>**Warning:**
3515
+
>
3516
+
> 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.
3517
+
3509
3518
- Scope: SESSION | GLOBAL
3510
3519
- Persists to cluster: Yes
3511
3520
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
3512
3521
- Type: Integer
3513
3522
- Default value: `1`
3514
3523
- Range: `[1, 256]`
3515
3524
- Unit: Threads
3516
-
- This variable is used to set the concurrency of the `serial scan` operation.
3517
-
- Use a bigger value in OLAP scenarios, and a smaller value in OLTP scenarios.
3525
+
- 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.
3518
3526
3519
3527
### tidb_init_chunk_size
3520
3528
@@ -4035,7 +4043,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified
4035
4043
- Persists to cluster: Yes
4036
4044
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No
4037
4045
- Default value: `1`
4038
-
-This variable specifies the concurrency of merging statistics for a partitioned table when TiDB analyzes the partitioned table.
4046
+
-Used to control the concurrency for merging TopN results of partitioned tables.
4039
4047
4040
4048
### tidb_enable_async_merge_global_stats <span class="version-mark">New in v7.5.0</span>
Copy file name to clipboardExpand all lines: tidb-cloud/v8.1-performance-benchmarking-with-tpcc.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,8 +96,8 @@ This section introduces how to perform the TPC-C performance test step by step.
96
96
97
97
```sql
98
98
SET tidb_build_stats_concurrency=16;
99
-
SET tidb_distsql_scan_concurrency=16;
100
-
SET tidb_index_serial_scan_concurrency=16;
99
+
SET tidb_build_sampling_stats_concurrency = 16;
100
+
SET tidb_analyze_distsql_scan_concurrency=16;
101
101
```
102
102
103
103
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.
Copy file name to clipboardExpand all lines: tidb-cloud/v8.5-performance-benchmarking-with-tpcc.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,8 +96,8 @@ This section introduces how to perform the TPC-C performance test step by step.
96
96
97
97
```sql
98
98
SET tidb_build_stats_concurrency=16;
99
-
SET tidb_distsql_scan_concurrency=16;
100
-
SET tidb_index_serial_scan_concurrency=16;
99
+
SET tidb_build_sampling_stats_concurrency = 16;
100
+
SET tidb_analyze_distsql_scan_concurrency=16;
101
101
```
102
102
103
103
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.
Copy file name to clipboardExpand all lines: troubleshoot-tidb-oom.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,7 +99,6 @@ You can take the following measures to reduce the memory usage of SQL statements
99
99
100
100
- 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:
- 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
0 commit comments