Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sysvar: add 12 sysvars to docs #10793

Merged
merged 4 commits into from
Oct 12, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
101 changes: 101 additions & 0 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,14 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a
- Default value: `OFF`
- This variable controls whether to enable the General Plan Cache feature.

### tidb_enable_historical_stats

- Scope: GLOBAL
- Persists to cluster: Yes
- Type: Boolean
- Default value: `OFF`
- This variable is used for an unreleased feature. **Do not change the variable value**.

### tidb_enable_index_merge <span class="version-mark">New in v4.0</span>

> **Note:**
Expand All @@ -1338,6 +1346,15 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a
- Default value: `ON`
- This variable is used to control whether to enable the index merge feature.

### tidb_enable_index_merge_join

- Scope: SESSION | GLOBAL
- Persists to cluster: Yes
- Type: Boolean
- Default value: `false`
TomShawn marked this conversation as resolved.
Show resolved Hide resolved
- Specifies whether to enable the `IndexMergeJoin` operator.
- This variable is used only for the internal operation of TiDB. It is **NOT recommended** to adjust it. Otherwise, data correctness might be affected.

### tidb_enable_legacy_instance_scope <span class="version-mark">New in v6.0.0</span>

- Scope: SESSION | GLOBAL
Expand All @@ -1355,6 +1372,14 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a
- Default value: `ON`
- This variable is used to set whether to enable the `LIST (COLUMNS) TABLE PARTITION` feature.

### tidb_enable_local_txn

- Scope: GLOBAL
- Persists to cluster: Yes
- Type: Boolean
- Default value: `OFF`
- This variable is used for an unreleased feature. **Do not change the variable value**.

### tidb_enable_metadata_lock <span class="version-mark">New in v6.3.0</span>

> **Warning:**
Expand Down Expand Up @@ -1472,6 +1497,14 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a
- Default value: `OFF`
- This variable controls whether to enable concurrency for the `Apply` operator. The number of concurrencies is controlled by the `tidb_executor_concurrency` variable. The `Apply` operator processes correlated subqueries and has no concurrency by default, so the execution speed is slow. Setting this variable value to `1` can increase concurrency and speed up execution. Currently, concurrency for `Apply` is disabled by default.

### tidb_enable_piplelined_window_function
TomShawn marked this conversation as resolved.
Show resolved Hide resolved

- Scope: SESSION | GLOBAL
- Persists to cluster: Yes
- Type: Boolean
- Default value: `true`
TomShawn marked this conversation as resolved.
Show resolved Hide resolved
- This variables specifies whether to use the pipeline execution algorithm for window functions.

### tidb_enable_prepared_plan_cache <span class="version-mark">New in v6.1.0</span>

- Scope: GLOBAL
Expand Down Expand Up @@ -1965,6 +1998,15 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified
- If you set this variable to `ON`, the process of fetching TS from the PD server is skipped, with the cost that only causal consistency is guaranteed but not linearizability. For more details, see the blog post [Async Commit, the Accelerator for Transaction Commit in TiDB 5.0](https://en.pingcap.com/blog/async-commit-the-accelerator-for-transaction-commit-in-tidb-5-0/).
- For scenarios that require only causal consistency, you can set this variable to `ON` to improve performance.

### tidb_hash_exchange_with_new_collation

- Scope: SESSION | GLOBAL
- Persists to cluster: Yes
- Type: Boolean
- Default value: `true`
TomShawn marked this conversation as resolved.
Show resolved Hide resolved
- This variable controls whether the MPP hash partition exchange operator is generated in a cluster with new collation enabled. `true` means to generate the operator, and `false` means not to generate it.
- This variable is used for the internal operation of TiDB. It is **not recommended** to set this variable.
TomShawn marked this conversation as resolved.
Show resolved Hide resolved

### tidb_hash_join_concurrency

> **Warning:**
Expand Down Expand Up @@ -2281,6 +2323,24 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified

</CustomContent>

### tidb_memory_debug_mode_alarm_ratio

- Scope: SESSION
- Persists to cluster: No
- Type: Float
- Default value: `0`
- This variable represents the memory statistics error value allowed in the TiDB memory debug mode.
- This variable is used for the internal testing of TiDB. It is **not recommended** to set this variable.
TomShawn marked this conversation as resolved.
Show resolved Hide resolved

### tidb_memory_debug_mode_min_heap_inuse

- Scope: SESSION
- Persists to cluster: No
- Type: INT64
- Default value: `0`
- This variable is used for the internal testing of TiDB. It is **not recommended** to set this variable. Enabling this variable will affect the performance of TiDB.
TomShawn marked this conversation as resolved.
Show resolved Hide resolved
- After configuring this parameter, TiDB will enter the memory debug mode to analyze the accuracy of memory tracking. TiDB will frequently trigger GC during the execution of subsequent SQL statements, and compare the actual memory usage and memory statistics. If the current memory usage is greater than `tidb_memory_debug_mode_min_heap_inuse` and the memory statistics error exceeds `tidb_memory_debug_mode_alarm_ratio`, TiDB will output the relevant memory information to the log and file.

### tidb_memory_usage_alarm_ratio

<CustomContent platform="tidb-cloud">
Expand Down Expand Up @@ -2310,6 +2370,14 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified

</CustomContent>

### tidb_merge_join_concurrency

- Scope: SESSION | GLOBAL
- Persists to cluster: Yes
- Default value: `1`
- This variable sets the concurrency of the `MergeJoin` operator when a query is executed.
- Warning: **It is not recommended to set this variable. Modifying the value of this variable might cause data correctness issues**.
TomShawn marked this conversation as resolved.
Show resolved Hide resolved

### tidb_metric_query_range_duration <span class="version-mark">New in v4.0</span>

<CustomContent platform="tidb-cloud">
Expand Down Expand Up @@ -3052,6 +3120,14 @@ Query OK, 0 rows affected, 1 warning (0.00 sec)
- Range: `[-1, 256]`
- This variable is used to set the maximum concurrency for TiFlash to execute a request. The default value is `-1`, indicating that this system variable is invalid. When the value is `0`, the maximum number of threads is automatically configured by TiFlash.

### tidb_mpp_store_fail_ttl

- Scope: SESSION | GLOBAL
- Persists to cluster: Yes
- Type: Duration
- Default value: `60s`
- The newly started TiFlash does not provide services. To prevent queries from failing, TiDB limits the tidb-server sending queries to the newly started TiFlash nodes. This variable indicates the time range in which the newly started TiFlash is not sent requests.

### tidb_slow_query_file

<CustomContent platform="tidb-cloud">
Expand Down Expand Up @@ -3171,6 +3247,14 @@ For details, see [Identify Slow Queries](/identify-slow-queries.md).
- Range: `[0, 9223372036854775807]`
- This variable is used to limit the maximum number of requests TiDB can send to TiKV at the same time. 0 means no limit.

### tidb_streamagg_concurrency

- Scope: SESSION | GLOBAL
- Persists to cluster: Yes
- Default value: `1`
- This variable sets the concurrency of the `StreamAgg` operator when queries are executed.
- Warning: **It is not recommended to set this variable. Modifying the variable value might cause data correctness issues**.
TomShawn marked this conversation as resolved.
Show resolved Hide resolved

### tidb_super_read_only <span class="version-mark">New in v5.3.1</span>

- Scope: GLOBAL
Expand Down Expand Up @@ -3462,6 +3546,23 @@ This variable is an alias for `transaction_isolation`.

Internally, the TiDB parser transforms the `SET TRANSACTION ISOLATION LEVEL [READ COMMITTED| REPEATABLE READ | ...]` statements to `SET @@SESSION.TX_ISOLATION_ONE_SHOT = [READ COMMITTED| REPEATABLE READ | ...]`.

### tx_read_ts

- Scope: SESSION
- Persists to cluster: No
- Default value: `0`
- In the Stale Read scenarios, this session variable is used to help record the Stable Read timestamp value.
- This variable is used for the internal operation of TiDB. It is **not recommended to set this variable**.
TomShawn marked this conversation as resolved.
Show resolved Hide resolved

### txn_scope

- Scope: SESSION
- Persists to cluster: No
- Default value: `global`
- Value options: `global` and `local`
- This variable is used to set whether the current session transaction is a global transaction or a local transaction.
- This variable is used for the internal operation of TiDB. It is **not recommended to set this variable**.
TomShawn marked this conversation as resolved.
Show resolved Hide resolved

### version

- Scope: NONE
Expand Down