Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion best-practices/tidb-best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion sql-statements/sql-statement-show-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,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)
2 changes: 1 addition & 1 deletion statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ When you analyze regular columns, you can use the [`tidb_distsql_scan_concurrenc

#### `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.
[`tidb_index_serial_scan_concurrency`](/system-variables.md#tidb_index_serial_scan_concurrency) is deprecated and read-only. Index statistics collection now follows [`tidb_analyze_distsql_scan_concurrency`](/system-variables.md#tidb_analyze_distsql_scan_concurrency), so adjust that variable to change the number of Regions read for index statistics.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

This sentence is a bit long and could be more direct. To improve clarity and follow the style guide's principle of using the second person, consider rephrasing.1

Suggested change
[`tidb_index_serial_scan_concurrency`](/system-variables.md#tidb_index_serial_scan_concurrency) is deprecated and read-only. Index statistics collection now follows [`tidb_analyze_distsql_scan_concurrency`](/system-variables.md#tidb_analyze_distsql_scan_concurrency), so adjust that variable to change the number of Regions read for index statistics.
[`tidb_index_serial_scan_concurrency`](/system-variables.md#tidb_index_serial_scan_concurrency) is deprecated and read-only. To control the number of Regions read for index statistics collection, you can adjust [`tidb_analyze_distsql_scan_concurrency`](/system-variables.md#tidb_analyze_distsql_scan_concurrency) instead.

Style Guide References

Footnotes

  1. The style guide recommends writing in the second person ('you') and avoiding unnecessary words for better clarity.


## See also

Expand Down
17 changes: 9 additions & 8 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -3506,15 +3506,16 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified

### tidb_index_serial_scan_concurrency

- Scope: SESSION | GLOBAL
> **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) to control index read concurrency.

- Scope: SESSION | GLOBAL (read-only)
- Persists to cluster: Yes
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Integer
- 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.
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No
- Type: Read-only integer alias
- Default value: matches the current value of [`tidb_executor_concurrency`](#tidb_executor_concurrency-new-in-v50)
- 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) to tune index statistics collection.
Comment thread
0xPoe marked this conversation as resolved.

### tidb_init_chunk_size

Expand Down
2 changes: 1 addition & 1 deletion tidb-cloud/v6.5-performance-benchmarking-with-tpcc.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ 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_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.
Expand Down
2 changes: 1 addition & 1 deletion tidb-cloud/v7.1-performance-benchmarking-with-tpcc.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ 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_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.
Expand Down
2 changes: 1 addition & 1 deletion tidb-cloud/v7.5-performance-benchmarking-with-tpcc.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ 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_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.
Expand Down
2 changes: 1 addition & 1 deletion tidb-cloud/v8.1-performance-benchmarking-with-tpcc.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ 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_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.
Expand Down
2 changes: 1 addition & 1 deletion tidb-cloud/v8.5-performance-benchmarking-with-tpcc.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ 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_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.
Expand Down
6 changes: 3 additions & 3 deletions tidb-lightning/tidb-lightning-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -564,9 +564,9 @@ Configures how CSV files are parsed.

#### `index-serial-scan-concurrency`

- Sets the TiDB session variable to speed up the Checksum and Analyze operations. For more information, see [Control `ANALYZE` concurrency](/statistics.md#control-analyze-concurrency).

<!-- Example: `20` -->
> **Warning:**
>
> Deprecated. TiDB Lightning keeps this option for compatibility, but TiDB now ignores the underlying `tidb_index_serial_scan_concurrency` system variable. Sequential index scans follow [`tidb_executor_concurrency`](/system-variables.md#tidb_executor_concurrency-new-in-v50), and index statistics collection follows [`tidb_analyze_distsql_scan_concurrency`](/system-variables.md#tidb_analyze_distsql_scan_concurrency).

#### `checksum-table-concurrency`

Expand Down
4 changes: 2 additions & 2 deletions troubleshoot-tidb-oom.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ 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_analyze_distsql_scan_concurrency`](/system-variables.md#tidb_analyze_distsql_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.
Expand Down Expand Up @@ -195,4 +195,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)
- [Tune TiKV Memory Parameter Performance](/tune-tikv-memory-performance.md)
Loading