diff --git a/system-variables.md b/system-variables.md index b8bc990fd44f7..9cd5203c8a1bb 100644 --- a/system-variables.md +++ b/system-variables.md @@ -31,20 +31,22 @@ SET GLOBAL tidb_distsql_scan_concurrency = 10; ### allow_auto_random_explicit_insert New in v4.0.3 -- Scope: SESSION (since v4.0.5: SESSION | GLOBAL) -- Default value: OFF +- Scope: SESSION | GLOBAL +- Default value: `OFF` - Determines whether to allow explicitly specifying the values of the column with the `AUTO_RANDOM` attribute in the `INSERT` statement. ### auto_increment_increment - Scope: SESSION | GLOBAL -- Default value: 1 +- Default value: `1` +- Range: `[1, 65535]` - Controls the step size of `AUTO_INCREMENT` values to be allocated to a column. It is often used in combination with `auto_increment_offset`. ### auto_increment_offset - Scope: SESSION | GLOBAL -- Default value: 1 +- Default value: `1` +- Range: `[1, 65535]` - Controls the initial offset of `AUTO_INCREMENT` values to be allocated to a column. This setting is often used in combination with `auto_increment_increment`. For example: ```sql @@ -76,7 +78,7 @@ mysql> SELECT * FROM t1; ### autocommit - Scope: SESSION | GLOBAL -- Default value: ON +- Default value: `ON` - Controls whether statements should automatically commit when not in an explicit transaction. See [Transaction Overview](/transaction-overview.md#autocommit) for more information. ### character_set_client @@ -125,13 +127,13 @@ mysql> SELECT * FROM t1; ### ddl_slow_threshold - Scope: INSTANCE -- Default value: 300 +- Default value: `300` - DDL operations whose execution time exceeds the threshold value are output to the log. The unit is millisecond. ### foreign_key_checks -- Scope: NONE -- Default value: OFF +- Scope: SESSION | GLOBAL +- Default value: `OFF` - For compatibility, TiDB returns foreign key checks as `OFF`. ### hostname @@ -143,25 +145,28 @@ mysql> SELECT * FROM t1; ### innodb_lock_wait_timeout - Scope: SESSION | GLOBAL -- Default value: 50 +- Default value: `50` +- Range: `[1, 1073741824]` - The lock wait timeout for pessimistic transactions (default) in seconds. ### interactive_timeout - Scope: SESSION | GLOBAL -- Default value: 28800 +- Default value: `28800` +- Range: `[1, 31536000]` +- Unit: Seconds - This variable represents the idle timeout of the interactive user session, which is measured in seconds. Interactive user session refers to the session established by calling [`mysql_real_connect()`](https://dev.mysql.com/doc/c-api/5.7/en/mysql-real-connect.html) API using the `CLIENT_INTERACTIVE` option (for example, MySQL shell client). This variable is fully compatible with MySQL. ### last_plan_from_binding New in v4.0 - Scope: SESSION -- Default value: 0 +- Default value: `OFF` - This variable is used to show whether the execution plan used in the previous statement was influenced by a [plan binding](/sql-plan-management.md) ### last_plan_from_cache New in v4.0 - Scope: SESSION -- Default value: 0 +- Default value: `OFF` - This variable is used to show whether the execution plan used in the previous `execute` statement is taken directly from the plan cache. ### license @@ -173,7 +178,9 @@ mysql> SELECT * FROM t1; ### max_execution_time - Scope: SESSION | GLOBAL -- Default value: 0 +- Default value: `0` +- Range: `[0, 2147483647]` +- Unit: Milliseconds - The maximum execution time of a statement in milliseconds. The default value is unlimited (zero). > **Note:** @@ -183,13 +190,14 @@ mysql> SELECT * FROM t1; ### port - Scope: NONE -- Default value: 4000 +- Default value: `4000` +- Range: `[0, 65535]` - The port that the `tidb-server` is listening on when speaking the MySQL protocol. ### socket - Scope: NONE -- Default value: '' +- Default value: "" - The local unix socket file that the `tidb-server` is listening on when speaking the MySQL protocol. ### sql_mode @@ -201,7 +209,8 @@ mysql> SELECT * FROM t1; ### sql_select_limit New in v4.0.2 - Scope: SESSION | GLOBAL -- Default value: `2^64 - 1` (18446744073709551615) +- Default value: `18446744073709551615` +- Range: `[0, 18446744073709551615]` - The maximum number of rows returned by the `SELECT` statements. ### system_time_zone @@ -213,7 +222,8 @@ mysql> SELECT * FROM t1; ### tidb_allow_batch_cop New in v4.0 - Scope: SESSION | GLOBAL -- Default value: 1 +- Default value: `1` +- Range: `[0, 2]` - This variable is used to control how TiDB sends a coprocessor request to TiFlash. It has the following values: * `0`: Never send requests in batches @@ -229,25 +239,26 @@ mysql> SELECT * FROM t1; ### tidb_allow_mpp New in v5.0 - Scope: SESSION | GLOBAL -- Default value: ON +- Default value: `ON` +- Possible values: `OFF`, `ON`, `ENFORCE` - This variable controls whether to use the MPP mode of TiFlash to execute queries. If the value is set to `ON`, TiDB automatically determines using the optimizer whether to choose MPP to execute queries. MPP is a distributed computing framework provided by the TiFlash engine, which allows data exchange between nodes and provides high-performance, high-throughput SQL algorithms. ### tidb_allow_remove_auto_inc New in v2.1.18 and v3.0.4 - Scope: SESSION -- Default value: OFF +- Default value: `OFF` - This variable is used to set whether the `AUTO_INCREMENT` property of a column is allowed to be removed by executing `ALTER TABLE MODIFY` or `ALTER TABLE CHANGE` statements. It is not allowed by default. ### tidb_auto_analyze_end_time - Scope: GLOBAL -- Default value: 23:59 +0000 +- Default value: `23:59 +0000` - This variable is used to restrict the time window that the automatic update of statistics is permitted. For example, to only allow automatic statistics updates between 1AM and 3AM, set `tidb_auto_analyze_start_time='01:00 +0000'` and `tidb_auto_analyze_end_time='03:00 +0000'`. ### tidb_auto_analyze_ratio - Scope: GLOBAL -- Default value: 0.5 +- Default value: `0.5` - This variable is used to set the threshold when TiDB automatically executes [`ANALYZE TABLE`](/sql-statements/sql-statement-analyze-table.md) in a background thread to update table statistics. For example, a value of 0.5 means that auto-analyze is triggered when greater than 50% of the rows in a table have been modified. Auto-analyze can be restricted to only execute during certain hours of the day by specifying `tidb_auto_analyze_start_time` and `tidb_auto_analyze_end_time`. > **Note:** @@ -257,19 +268,21 @@ mysql> SELECT * FROM t1; ### tidb_auto_analyze_start_time - Scope: GLOBAL -- Default value: 00:00 +0000 +- Default value: `00:00 +0000` - This variable is used to restrict the time window that the automatic update of statistics is permitted. For example, to only allow automatic statistics updates between 1AM and 3AM, set `tidb_auto_analyze_start_time='01:00 +0000'` and `tidb_auto_analyze_end_time='03:00 +0000'`. ### tidb_backoff_lock_fast - Scope: SESSION | GLOBAL -- Default value: 100 +- Default value: `100` +- Range: `[1, 2147483647]` - This variable is used to set the `backoff` time when the read request meets a lock. ### tidb_backoff_weight - Scope: SESSION | GLOBAL -- Default value: 2 +- Default value: `2` +- Range: `[1, 2147483647]` - This variable is used to increase the weight of the maximum time of TiDB `backoff`, that is, the maximum retry time for sending a retry request when an internal network or other component (TiKV, PD) failure is encountered. This variable can be used to adjust the maximum retry time and the minimum value is 1. For example, the base timeout for TiDB to take TSO from PD is 15 seconds. When `tidb_backoff_weight = 2`, the maximum timeout for taking TSO is: *base time \* 2 = 30 seconds*. @@ -279,40 +292,43 @@ mysql> SELECT * FROM t1; ### tidb_broadcast_join_threshold_count New in v5.0 - Scope: SESSION | GLOBAL -- Default value: 10240 +- Default value: `10240` +- Range: `[0, 9223372036854775807]` - The unit of the variable is rows. If the objects of the join operation belong to a subquery, the optimizer cannot estimate the size of the subquery result set. In this situation, the size is determined by the number of rows in the result set. If the estimated number of rows in the subquery is less than the value of this variable, the Broadcast Hash Join algorithm is used. Otherwise, the Shuffled Hash Join algorithm is used. ### tidb_broadcast_join_threshold_size New in v5.0 - Scope: SESSION | GLOBAL -- Default value: 104857600 (which equals 100 megabytes) -- If the table size (in the unit of bytes) is less than the value of the variable, the Broadcast Hash Join algorithm is used. Otherwise, the Shuffled Hash Join algorithm is used. +- Default value: `104857600` (100 MiB) +- Range: `[0, 9223372036854775807]` +- Unit: Bytes +- If the table size is less than the value of the variable, the Broadcast Hash Join algorithm is used. Otherwise, the Shuffled Hash Join algorithm is used. ### tidb_build_stats_concurrency -- Scope: SESSION -- Default value: 4 +- Scope: SESSION | GLOBAL +- Default value: `4` - 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. ### tidb_capture_plan_baselines New in v4.0 - Scope: SESSION | GLOBAL -- Default value: OFF +- Default value: `OFF` - This variable is used to control whether to enable the [baseline capturing](/sql-plan-management.md#baseline-capturing) feature. This feature depends on the statement summary, so you need to enable the statement summary before you use baseline capturing. - After this feature is enabled, the historical SQL statements in the statement summary are traversed periodically, and bindings are automatically created for SQL statements that appear at least twice. ### tidb_check_mb4_value_in_utf8 - Scope: INSTANCE -- Default value: ON +- Default value: `ON` - This variable is used to enforce that the `utf8` character set only stores values from the [Basic Multilingual Plane (BMP)](https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane). To store characters outside the BMP, it is recommended to use the `utf8mb4` character set. - You might need to disable this option when upgrading your cluster from an earlier version of TiDB where the `utf8` checking was more relaxed. For details, see [FAQs After Upgrade](/faq/upgrade-faq.md). ### tidb_checksum_table_concurrency - Scope: SESSION -- Default value: 4 +- Default value: `4` - This variable is used to set the scan index concurrency of executing the `ADMIN CHECKSUM TABLE` statement. - When the variable is set to a larger value, the execution performance of other queries is affected. @@ -325,7 +341,7 @@ mysql> SELECT * FROM t1; ### tidb_constraint_check_in_place - Scope: SESSION | GLOBAL -- Default value: OFF +- Default value: `OFF` - This setting only applies to optimistic transactions. When this variable is set to `OFF`, checking for duplicate values in UNIQUE indexes is deferred until the transaction commits. This helps improve performance, but might be an unexpected behavior for some applications. See [Constraints](/constraints.md) for details. - When set to zero and using optimistic transactions: @@ -354,19 +370,21 @@ Constraint checking is always performed in place for pessimistic transactions (d ### tidb_current_ts - Scope: SESSION -- Default value: 0 +- Default value: `0` - This variable is read-only. It is used to obtain the timestamp of the current transaction. ### tidb_ddl_error_count_limit - Scope: GLOBAL -- Default value: 512 +- Default value: `512` +- Range: `[0, 9223372036854775807]` - This variable is used to set the number of retries when the DDL operation fails. When the number of retries exceeds the parameter value, the wrong DDL operation is canceled. ### tidb_ddl_reorg_batch_size - Scope: GLOBAL -- Default value: 256 +- Default value: `256` +- Range: `[32, 10240]` - This variable is used to set the batch size during the `re-organize` phase of the DDL operation. For example, when TiDB executes the `ADD INDEX` operation, the index data needs to backfilled by `tidb_ddl_reorg_worker_cnt` (the number) concurrent workers. Each worker backfills the index data in batches. - If many updating operations such as `UPDATE` and `REPLACE` exist during the `ADD INDEX` operation, a larger batch size indicates a larger probability of transaction conflicts. In this case, you need to adjust the batch size to a smaller value. The minimum value is 32. - If the transaction conflict does not exist, you can set the batch size to a large value. The maximum value is 10240. This can increase the speed of the backfilling data, but the write pressure on TiKV also becomes higher. @@ -381,13 +399,14 @@ Constraint checking is always performed in place for pessimistic transactions (d ### tidb_ddl_reorg_worker_cnt - Scope: GLOBAL -- Default value: 4 +- Default value: `4` +- Range: `[1, 128]` - This variable is used to set the concurrency of the DDL operation in the `re-organize` phase. ### tidb_disable_txn_auto_retry - Scope: SESSION | GLOBAL -- Default value: ON +- Default value: `ON` - This variable is used to set whether to disable the automatic retry of explicit optimistic transactions. The default value of `ON` means that transactions will not automatically retry in TiDB and `COMMIT` statements might return errors that need to be handled in the application layer. Setting the value to `OFF` means that TiDB will automatically retry transactions, resulting in fewer errors from `COMMIT` statements. Be careful when making this change, because it might result in lost updates. @@ -401,7 +420,8 @@ Constraint checking is always performed in place for pessimistic transactions (d ### tidb_distsql_scan_concurrency - Scope: SESSION | GLOBAL -- Default value: 15 +- Default value: `15` +- Range: `[1, 2147483647]` - This variable is used to set the concurrency of the `scan` operation. - Use a bigger value in OLAP scenarios, and a smaller value in OLTP scenarios. - For OLAP scenarios, the maximum value cannot exceed the number of CPU cores of all the TiKV nodes. @@ -410,25 +430,27 @@ Constraint checking is always performed in place for pessimistic transactions (d ### tidb_dml_batch_size - Scope: SESSION | GLOBAL -- Default value: 0 +- Default value: `0` +- Range: `[0, 2147483647]` - When this value is greater than `0`, TiDB will batch commit statements such as `INSERT` or `LOAD DATA` into smaller transactions. This reduces memory usage and helps ensure that the `txn-total-size-limit` is not reached by bulk modifications. - Only the value `0` provides ACID compliance. Setting this to any other value will break the atomicity and isolation guarantees of TiDB. ### tidb_enable_1pc New in v5.0 - Scope: SESSION | GLOBAL -- Default value: For newly created clusters, the default value of v5.0 RC is `OFF` and the default value of v5.0 GA or later is `ON`. If your cluster was upgraded to v5.0 GA from v5.0 RC, the variable value stays unchanged. If your cluster is upgraded to v5.0 GA from v4.0 or earlier, the variable value defaults to `OFF` after the upgrade. +- Default value: `ON` - This variable is used to specify whether to enable the one-phase commit feature for transactions that only affect one Region. Compared with the often-used two-phase commit, one-phase commit can greatly reduce the latency of transaction commit and increase the throughput. > **Note:** > +> - The default value of `ON` only applies to new clusters. If your cluster was upgraded to v5.0.0 or later from an earlier version of TiDB, the value `OFF` will be used instead. > - If you have enabled TiDB Binlog, enabling this variable cannot improve the performance. To improve the performance, it is recommended to use [TiCDC](/ticdc/ticdc-overview.md) instead. > - Enabling this parameter only means that one-phase commit becomes an optional mode of transaction commit. In fact, the most suitable mode of transaction commit is determined by TiDB. ### tidb_enable_amend_pessimistic_txn New in v4.0.7 - Scope: SESSION | GLOBAL -- Default value: OFF +- Default value: `OFF` - This variable is used to control whether to enable the `AMEND TRANSACTION` feature. If you enable the `AMEND TRANSACTION` feature in a pessimistic transaction, when concurrent DDL operations and SCHEMA VERSION changes exist on tables associated with this transaction, TiDB attempts to amend the transaction. TiDB corrects the transaction commit to make the commit consistent with the latest valid SCHEMA VERSION so that the transaction can be successfully committed without getting the `Information schema is changed` error. This feature is effective on the following concurrent DDL operations: - `ADD COLUMN` or `DROP COLUMN` operations. @@ -442,30 +464,32 @@ Constraint checking is always performed in place for pessimistic transactions (d ### tidb_enable_async_commit New in v5.0 - Scope: SESSION | GLOBAL -- Default value: For newly created clusters, the default value of v5.0 RC is `OFF` and the default value of v5.0 GA or later is `ON`. If your cluster was upgraded to v5.0 GA from v5.0 RC, the variable value stays unchanged. If your cluster is upgraded to v5.0 GA from v4.0 or earlier, the variable value defaults to `OFF` after the upgrade. +- Default value: `ON` - This variable controls whether to enable the async commit feature for the second phase of the two-phase transaction commit to perform asynchronously in the background. Enabling this feature can reduce the latency of transaction commit. > **Note:** > +> - The default value of `ON` only applies to new clusters. If your cluster was upgraded to v5.0.0 or later from an earlier version of TiDB, the value `OFF` will be used instead. > - If you have enabled TiDB Binlog, enabling this variable cannot improve the performance. To improve the performance, it is recommended to use [TiCDC](/ticdc/ticdc-overview.md) instead. > - Enabling this parameter only means that Async Commit becomes an optional mode of transaction commit. In fact, the most suitable mode of transaction commit is determined by TiDB. ### tidb_enable_cascades_planner - Scope: SESSION | GLOBAL -- Default value: OFF +- Default value: `OFF` - This variable is used to control whether to enable the cascades planner, which is currently considered experimental. ### tidb_enable_chunk_rpc New in v4.0 - Scope: SESSION -- Default value: ON +- Default value: `ON` - This variable is used to control whether to enable the `Chunk` data encoding format in Coprocessor. ### tidb_enable_clustered_index New in v5.0 - Scope: SESSION | GLOBAL -- Default value: INT_ONLY +- Default value: `INT_ONLY` +- Possible values: `OFF`, `ON`, `INT_ONLY` - This variable is used to control whether to create the primary key as a [clustered index](/clustered-indexes.md) by default. "By default" here means that the statement does not explicitly specify the keyword `CLUSTERED`/`NONCLUSTERED`. Supported values are `OFF`, `ON`, and `INT_ONLY`: - `OFF` indicates that primary keys are created as non-clustered indexes by default. - `ON` indicates that primary keys are created as clustered indexes by default. @@ -474,20 +498,20 @@ Constraint checking is always performed in place for pessimistic transactions (d ### tidb_enable_collect_execution_info - Scope: INSTANCE -- Default value: ON +- Default value: `ON` - This variable controls whether to record the execution information of each operator in the slow query log. ### tidb_enable_fast_analyze - Scope: SESSION | GLOBAL -- Default value: OFF +- Default value: `OFF` - This variable is used to set whether to enable the statistics `Fast Analyze` feature. - If the statistics `Fast Analyze` feature is enabled, TiDB randomly samples about 10,000 rows of data as statistics. When the data is distributed unevenly or the data size is small, the statistics accuracy is low. This might lead to a non-optimal execution plan, for example, selecting a wrong index. If the execution time of the regular `Analyze` statement is acceptable, it is recommended to disable the `Fast Analyze` feature. ### tidb_enable_index_merge New in v4.0 - Scope: SESSION | GLOBAL -- Default value: OFF +- Default value: `OFF` - This variable is used to control whether to enable the index merge feature. ### tidb_enable_list_partition New in v5.0 @@ -497,13 +521,13 @@ Constraint checking is always performed in place for pessimistic transactions (d > Currently, List partition and List COLUMNS partition are experimental features. It is not recommended that you use it in the production environment. - Scope: SESSION -- Default value: OFF +- Default value: `OFF` - This variable is used to set whether to enable the `LIST (COLUMNS) TABLE PARTITION` feature. ### tidb_enable_noop_functions New in v4.0 - Scope: SESSION | GLOBAL -- Default value: OFF +- Default value: `OFF` - By default, TiDB returns an error when you attempt to use the syntax for functionality that is not yet implemented. When the variable value is set to `ON`, TiDB silently ignores such cases of unavailable functionality, which is helpful if you cannot make changes to the SQL code. - Enabling `noop` functions controls the following behaviors: * `get_lock` and `release_lock` functions @@ -517,32 +541,32 @@ Constraint checking is always performed in place for pessimistic transactions (d ### tidb_enable_parallel_apply New in v5.0 - Scope: SESSION | GLOBAL -- Default value: 0 +- 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_rate_limit_action - Scope: SESSION | GLOBAL -- Default value: ON +- Default value: `ON` - This variable controls whether to enable the dynamic memory control feature for the operator that reads data. By default, this operator enables the maximum number of threads that [`tidb_disql_scan_concurrency`](/system-variables.md#tidb_distsql_scan_concurrency) allows to read data. When the memory usage of a single SQL statement exceeds [`tidb_mem_quota_query`](/system-variables.md#tidb_mem_quota_query) each time, the operator that reads data stops one thread. - When the operator that reads data has only one thread left and the memory usage of a single SQL statement continues to exceed [`tidb_mem_quota_query`](/system-variables.md#tidb_mem_quota_query), this SQL statement triggers other memory control behaviors, such as [spilling data to disk](/tidb-configuration-file.md#spilled-file-encryption-method). ### tidb_enable_slow_log - Scope: INSTANCE -- Default value: ON +- Default value: `ON` - This variable is used to control whether to enable the slow log feature. ### tidb_enable_stmt_summary New in v3.0.4 - Scope: SESSION | GLOBAL -- Default value: ON (the value of the default configuration file) +- Default value: `ON` - This variable is used to control whether to enable the statement summary feature. If enabled, SQL execution information like time consumption is recorded to the `information_schema.STATEMENTS_SUMMARY` system table to identify and troubleshoot SQL performance issues. ### tidb_enable_strict_double_type_check New in v5.0 - Scope: SESSION | GLOBAL -- Default value: ON +- Default value: `ON` - This variable is used to control if tables can be created with invalid definitions of type `DOUBLE`. This setting is intended to provide an upgrade path from earlier versions of TiDB, which were less strict in validating types. - The default value of `ON` is compatible with MySQL. @@ -566,7 +590,8 @@ Query OK, 0 rows affected (0.09 sec) ### tidb_enable_table_partition - Scope: SESSION | GLOBAL -- Default value: ON +- Default value: `ON` +- Possible values: `OFF`, `ON`, `AUTO` - This variable is used to set whether to enable the `TABLE PARTITION` feature: - `ON` indicates enabling Range partitioning, Hash partitioning, and Range column partitioning with one single column. - `AUTO` functions the same way as `ON` does. @@ -575,25 +600,25 @@ Query OK, 0 rows affected (0.09 sec) ### tidb_enable_telemetry New in v4.0.2 - Scope: GLOBAL -- Default value: ON +- Default value: `ON` - This variable is used to dynamically control whether the telemetry collection in TiDB is enabled. By setting the value to `OFF`, the telemetry collection is disabled. If the [`enable-telemetry`](/tidb-configuration-file.md#enable-telemetry-new-in-v402) TiDB configuration item is set to `false` on all TiDB instances, the telemetry collection is always disabled and this system variable will not take effect. See [Telemetry](/telemetry.md) for details. ### tidb_enable_vectorized_expression New in v4.0 - Scope: SESSION | GLOBAL -- Default value: ON +- Default value: `ON` - This variable is used to control whether to enable vectorized execution. ### tidb_enable_window_function - Scope: SESSION | GLOBAL -- Default value: ON +- Default value: `ON` - This variable is used to control whether to enable the support for window functions. Note that window functions may use reserved keywords. This might cause SQL statements that could be executed normally cannot be parsed after upgrading TiDB. In this case, you can set `tidb_enable_window_function` to `OFF`. ### tidb_evolve_plan_baselines New in v4.0 - Scope: SESSION | GLOBAL -- Default value: OFF +- Default value: `OFF` - This variable is used to control whether to enable the baseline evolution feature. For detailed introduction or usage , see [Baseline Evolution](/sql-plan-management.md#baseline-evolution). - To reduce the impact of baseline evolution on the cluster, use the following configurations: - Set `tidb_evolve_plan_task_max_time` to limit the maximum execution time of each execution plan. The default value is 600s. @@ -602,25 +627,27 @@ Query OK, 0 rows affected (0.09 sec) ### tidb_evolve_plan_task_end_time New in v4.0 - Scope: GLOBAL -- Default value: 23:59 +0000 +- Default value: `23:59 +0000` - This variable is used to set the end time of baseline evolution in a day. ### tidb_evolve_plan_task_max_time New in v4.0 - Scope: GLOBAL -- Default value: 600 +- Default value: `600` +- Range: `[-1, 9223372036854775807]` - This variable is used to limit the maximum execution time of each execution plan in the baseline evolution feature. The unit is second. ### tidb_evolve_plan_task_start_time New in v4.0 - Scope: GLOBAL -- Default value: 00:00 +0000 +- Default value: `00:00 +0000` - This variable is used to set the start time of baseline evolution in a day. ### tidb_executor_concurrency New in v5.0 - Scope: SESSION | GLOBAL -- Default value: 5 +- Default value: `5` +- Range: `[1, 2147483647]` This variable is used to set the concurrency of the following SQL operators (to one value): @@ -648,7 +675,8 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified ### tidb_expensive_query_time_threshold - Scope: INSTANCE -- Default value: 60 +- Default value: `60` +- Range: `[10, 2147483647]` - This variable is used to set the threshold value that determines whether to print expensive query logs. The unit is second. The difference between expensive query logs and slow query logs is: - Slow logs are printed after the statement is executed. - Expensive query logs print the statements that are being executed, with execution time exceeding the threshold value, and their related information. @@ -656,26 +684,27 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified ### tidb_force_priority - Scope: INSTANCE -- Default value: NO_PRIORITY +- Default value: `NO_PRIORITY` - This variable is used to change the default priority for statements executed on a TiDB server. A use case is to ensure that a particular user that is performing OLAP queries receives lower priority than users performing OLTP queries. - You can set the value of this variable to `NO_PRIORITY`, `LOW_PRIORITY`, `DELAYED` or `HIGH_PRIORITY`. ### tidb_gc_concurrency New in v5.0 - Scope: GLOBAL -- Default: -1 +- Default value: `-1` +- Range: `[1, 128]` - Specifies the number of threads in the [Resolve Locks](/garbage-collection-overview.md#resolve-locks) step of GC. A value of `-1` means that TiDB will automatically decide the number of garbage collection threads to use. ### tidb_gc_enable New in v5.0 - Scope: GLOBAL -- Default value: ON +- Default value: `ON` - Enables garbage collection for TiKV. Disabling garbage collection will reduce system performance, as old versions of rows will no longer be purged. ### tidb_gc_life_time New in v5.0 - Scope: GLOBAL -- Default: `"10m0s"` +- Default value: `10m0s` - The time limit during which data is retained for each GC, in the format of Go Duration. When a GC happens, the current time minus this value is the safe point. > **Note:** @@ -688,7 +717,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified ### tidb_gc_run_interval New in v5.0 - Scope: GLOBAL -- Default value: `"10m0s"` +- Default value: `10m0s` - Specifies the GC interval, in the format of Go Duration, for example, `"1h30m"`, and `"15m"` ### tidb_gc_scan_lock_mode New in v5.0 @@ -699,7 +728,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Scope: GLOBAL - Default value: `LEGACY` -- Possible values: +- Possible values: `PHYSICAL`, `LEGACY` - `LEGACY`: Uses the old way of scanning, that is, disable Green GC. - `PHYSICAL`: Uses the physical scanning method, that is, enable Green GC. - This variable specifies the way of scanning locks in the Resolve Locks step of GC. When the variable value is set to `LEGACY`, TiDB scans locks by Regions. When the value `PHYSICAL` is used, it enables each TiKV node to bypass the Raft layer and directly scan data, which can effectively mitigate the impact of GC wakening up all Regions when the [Hibernate Region](/tikv-configuration-file.md#hibernate-regions) feature is enabled, thus improving the execution speed in the Resolve Locks step. @@ -707,7 +736,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified ### tidb_general_log - Scope: INSTANCE -- Default value: OFF +- Default value: `OFF` - This variable is used to set whether to record all SQL statements in the [log](/tidb-configuration-file.md#logfile). This feature is disabled by default. If maintenance personnel needs to trace all SQL statements when locating issues, they can enable this feature. - To see all records of this feature in the log, query the `"GENERAL_LOG"` string. The following information is recorded: - `conn`: The ID of the current session. @@ -727,7 +756,8 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified > Since v5.0, this variable is deprecated. Instead, use [`tidb_executor_concurrency`](#tidb_executor_concurrency-new-in-v50) for setting. - Scope: SESSION | GLOBAL -- Default value: -1 +- Default value: `-1` +- Range: `[1, 2147483647]` - This variable is used to set the concurrency of the `hash join` algorithm. - A value of `-1` means that the value of `tidb_executor_concurrency` will be used instead. @@ -738,7 +768,8 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified > Since v5.0, this variable is deprecated. Instead, use [`tidb_executor_concurrency`](#tidb_executor_concurrency-new-in-v50) for setting. - Scope: SESSION | GLOBAL -- Default value: -1 +- Default value: `-1` +- Range: `[1, 2147483647]` - This variable is used to set the concurrency of executing the concurrent `hash aggregation` algorithm in the `final` phase. - When the parameter of the aggregate function is not distinct, `HashAgg` is run concurrently and respectively in two phases - the `partial` phase and the `final` phase. - A value of `-1` means that the value of `tidb_executor_concurrency` will be used instead. @@ -750,7 +781,8 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified > Since v5.0, this variable is deprecated. Instead, use [`tidb_executor_concurrency`](#tidb_executor_concurrency-new-in-v50) for setting. - Scope: SESSION | GLOBAL -- Default value: -1 +- Default value: `-1` +- Range: `[1, 2147483647]` - This variable is used to set the concurrency of executing the concurrent `hash aggregation` algorithm in the `partial` phase. - When the parameter of the aggregate function is not distinct, `HashAgg` is run concurrently and respectively in two phases - the `partial` phase and the `final` phase. - A value of `-1` means that the value of `tidb_executor_concurrency` will be used instead. @@ -758,7 +790,8 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified ### tidb_index_join_batch_size - Scope: SESSION | GLOBAL -- Default value: 25000 +- Default value: `25000` +- Range: `[1, 2147483647]` - This variable is used to set the batch size of the `index lookup join` operation. - Use a bigger value in OLAP scenarios, and a smaller value in OLTP scenarios. @@ -769,7 +802,8 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified > Since v5.0, this variable is deprecated. Instead, use [`tidb_executor_concurrency`](#tidb_executor_concurrency-new-in-v50) for setting. - Scope: SESSION | GLOBAL -- Default value: -1 +- Default value: `-1` +- Range: `[1, 2147483647]` - This variable is used to set the concurrency of the `index lookup` operation. - Use a bigger value in OLAP scenarios, and a smaller value in OLTP scenarios. - A value of `-1` means that the value of `tidb_executor_concurrency` will be used instead. @@ -781,95 +815,105 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified > Since v5.0, this variable is deprecated. Instead, use [`tidb_executor_concurrency`](#tidb_executor_concurrency-new-in-v50) for setting. - Scope: SESSION | GLOBAL -- Default value: -1 +- Default value: `-1` +- Range: `[1, 2147483647]` - This variable is used to set the concurrency of the `index lookup join` algorithm. - A value of `-1` means that the value of `tidb_executor_concurrency` will be used instead. ### tidb_index_lookup_size - Scope: SESSION | GLOBAL -- Default value: 20000 +- Default value: `20000` +- Range: `[1, 2147483647]` - This variable is used to set the batch size of the `index lookup` operation. - Use a bigger value in OLAP scenarios, and a smaller value in OLTP scenarios. ### tidb_index_serial_scan_concurrency - Scope: SESSION | GLOBAL -- Default value: 1 +- Default value: `1` +- Range: `[1, 2147483647]` - 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. ### tidb_init_chunk_size - Scope: SESSION | GLOBAL -- Default value: 32 -- Range: 1 - 32 +- Default value: `32` +- Range: `[1, 32]` - This variable is used to set the number of rows for the initial chunk during the execution process. ### tidb_isolation_read_engines New in v4.0 - Scope: SESSION -- Default value: tikv, tiflash, tidb +- Default value: `tikv,tiflash,tidb` - This variable is used to set the storage engine list that TiDB can use when reading data. ### tidb_low_resolution_tso - Scope: SESSION -- Default value: OFF +- Default value: `OFF` - This variable is used to set whether to enable the low precision TSO feature. After this feature is enabled, new transactions use a timestamp updated every 2 seconds to read data. - The main applicable scenario is to reduce the overhead of acquiring TSO for small read-only transactions when reading old data is acceptable. ### tidb_max_chunk_size - Scope: SESSION | GLOBAL -- Default value: 1024 -- Minimum value: 32 +- Default value: `1024` +- Range: `[32, 2147483647]` - This variable is used to set the maximum number of rows in a chunk during the execution process. Setting to too large of a value may cause cache locality issues. ### tidb_max_delta_schema_count New in v2.1.18 and v3.0.5 - Scope: GLOBAL -- Default value: 1024 +- Default value: `1024` +- Range: `[100, 16384]` - This variable is used to set the maximum number of schema versions (the table IDs modified for corresponding versions) allowed to be cached. The value range is 100 ~ 16384. ### tidb_mem_quota_apply_cache New in v5.0 - Scope: SESSION | GLOBAL -- Default value: 32 MB +- Default value: `33554432` (32 MiB) +- Range: `[0, 9223372036854775807]` +- Unit: Bytes - This variable is used to set the memory usage threshold of the local cache in the `Apply` operator. - The local cache in the `Apply` operator is used to speed up the computation of the `Apply` operator. You can set the variable to `0` to disable the `Apply` cache feature. ### tidb_mem_quota_query - Scope: SESSION -- Default value: 1 GB +- Default value: `1073741824` (1 GiB) +- Range: `[-1, 9223372036854775807]` +- Unit: Bytes - This variable is used to set the threshold value of memory quota for a query. - If the memory quota of a query during execution exceeds the threshold value, TiDB performs the operation designated by the OOMAction option in the configuration file. The initial value of this variable is configured by [`mem-quota-query`](/tidb-configuration-file.md#mem-quota-query). ### tidb_memory_usage_alarm_ratio - Scope: SESSION -- Default value: 0.8 +- Default value: `0.8` - TiDB triggers an alarm when the percentage of the memory it takes exceeds a certain threshold. For the detailed usage description of this feature, see [`memory-usage-alarm-ratio`](/tidb-configuration-file.md#memory-usage-alarm-ratio-new-in-v409). - You can set the initial value of this variable by configuring [`memory-usage-alarm-ratio`](/tidb-configuration-file.md#memory-usage-alarm-ratio-new-in-v409). ### tidb_metric_query_range_duration New in v4.0 - Scope: SESSION -- Default value: 60 +- Default value: `60` +- Range: `[10, 216000]` - This variable is used to set the range duration of the Prometheus statement generated when querying METRIC_SCHEMA. The unit is second. ### tidb_metric_query_step New in v4.0 - Scope: SESSION -- Default value: 60 +- Default value: `60` +- Range: `[10, 216000]` - This variable is used to set the step of the Prometheus statement generated when querying `METRIC_SCHEMA`. The unit is second. ### tidb_multi_statement_mode New in v4.0.11 - Scope: SESSION | GLOBAL -- Default value: OFF -- Permitted values: OFF, ON, WARN +- Default value: `OFF` +- Possible values: `OFF`, `ON`, `WARN` - This variable controls whether to allow multiple queries to be executed in the same `COM_QUERY` call. - To reduce the impact of SQL injection attacks, TiDB now prevents multiple queries from being executed in the same `COM_QUERY` call by default. This variable is intended to be used as part of an upgrade path from earlier versions of TiDB. The following behaviors apply: @@ -893,14 +937,15 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified ### tidb_opt_agg_push_down - Scope: SESSION -- Default value: OFF +- Default value: `OFF` - This variable is used to set whether the optimizer executes the optimization operation of pushing down the aggregate function to the position before Join, Projection, and UnionAll. - When the aggregate operation is slow in query, you can set the variable value to ON. ### tidb_opt_correlation_exp_factor - Scope: SESSION | GLOBAL -- Default value: 1 +- Default value: `1` +- Range: `[0, 2147483647]` - When the method that estimates the number of rows based on column order correlation is not available, the heuristic estimation method is used. This variable is used to control the behavior of the heuristic method. - When the value is 0, the heuristic method is not used. - When the value is greater than 0: @@ -910,13 +955,13 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified ### tidb_opt_correlation_threshold - Scope: SESSION | GLOBAL -- Default value: 0.9 +- Default value: `0.9` - This variable is used to set the threshold value that determines whether to enable estimating the row count by using column order correlation. If the order correlation between the current column and the `handle` column exceeds the threshold value, this method is enabled. ### tidb_opt_distinct_agg_push_down - Scope: SESSION -- Default value: OFF +- Default value: `OFF` - This variable is used to set whether the optimizer executes the optimization operation of pushing down the aggregate function with `distinct` (such as `select count(distinct a) from t`) to Coprocessor. - When the aggregate function with the `distinct` operation is slow in the query, you can set the variable value to `1`. @@ -951,7 +996,7 @@ mysql> desc select count(distinct a) from test.t; ### tidb_opt_insubq_to_join_and_agg - Scope: SESSION | GLOBAL -- Default value: ON +- Default value: `ON` - This variable is used to set whether to enable the optimization rule that converts a subquery to join and aggregation. - For example, after you enable this optimization rule, the subquery is converted as follows: @@ -974,7 +1019,7 @@ mysql> desc select count(distinct a) from test.t; ### tidb_opt_prefer_range_scan New in v5.0 - Scope: SESSION -- Default value: 0 +- Default value: `OFF` - After you set the value of this variable to `1`, the optimizer always prefers index scans over full table scans. - In the following example, before you enable `tidb_opt_prefer_range_scan`, the TiDB optimizer performs a full table scan. After you enable `tidb_opt_prefer_range_scan`, the optimizer selects an index scan. @@ -1005,13 +1050,14 @@ explain select * from t where age=5; ### tidb_opt_write_row_id - Scope: SESSION -- Default value: OFF +- Default value: `OFF` - This variable is used to control whether to allow `INSERT`, `REPLACE`, and `UPDATE` statements to operate on the `_tidb_rowid` column. This variable can be used only when you import data using TiDB tools. ### tidb_pprof_sql_cpu New in v4.0 - Scope: INSTANCE -- Default value: 0 +- Default value: `0` +- Range: `[0, 1]` - This variable is used to control whether to mark the corresponding SQL statement in the profile output to identify and troubleshoot performance issues. ### tidb_projection_concurrency @@ -1021,14 +1067,17 @@ explain select * from t where age=5; > Since v5.0, this variable is deprecated. Instead, use [`tidb_executor_concurrency`](#tidb_executor_concurrency-new-in-v50) for setting. - Scope: SESSION | GLOBAL -- Default value: -1 +- Default value: `-1` +- Range: `[-1, 2147483647]` - This variable is used to set the concurrency of the `Projection` operator. - A value of `-1` means that the value of `tidb_executor_concurrency` will be used instead. ### tidb_query_log_max_len - Scope: INSTANCE -- Default value: 4096 (bytes) +- Default value: `4096` (4 KiB) +- Range: `[-1, 9223372036854775807]` +- Unit: Bytes - The maximum length of the SQL statement output. When the output length of a statement is larger than the `tidb_query-log-max-len` value, the statement is truncated to output. Usage example: @@ -1040,20 +1089,21 @@ SET tidb_query_log_max_len = 20 ### tidb_record_plan_in_slow_log - Scope: INSTANCE -- Default value: `1` +- Default value: `ON` - This variable is used to control whether to include the execution plan of slow queries in the slow log. ### tidb_redact_log - Scope: SESSION | GLOBAL -- Default value: OFF +- Default value: `OFF` - This variable controls whether to hide user information in the SQL statement being recorded into the TiDB log and slow log. - When you set the variable to `1`, user information is hidden. For example, if the executed SQL statement is `insert into t values (1,2)`, the statement is recorded as `insert into t values (?,?)` in the log. ### tidb_replica_read New in v4.0 - Scope: SESSION -- Default value: leader +- Default value: `leader` +- Possible values: `leader`, `follower`, `leader-and-follower` - This variable is used to control where TiDB reads data. Here are three options: - leader: Read only from leader node - follower: Read only from follower node @@ -1063,13 +1113,15 @@ SET tidb_query_log_max_len = 20 ### tidb_retry_limit - Scope: SESSION | GLOBAL -- Default value: 10 +- Default value: `10` +- Range: `[-1, 9223372036854775807]` - This variable is used to set the maximum number of the retries for optimistic transactions. When a transaction encounters retryable errors (such as transaction conflicts, very slow transaction commit, or table schema changes), this transaction is re-executed according to this variable. Note that setting `tidb_retry_limit` to `0` disables the automatic retry. This variable only applies to optimistic transactions, not to pessimistic transactions. ### tidb_row_format_version - Scope: GLOBAL - Default value: `2` +- Range: `[1, 2]` - Controls the format version of the newly saved data in the table. In TiDB v4.0, the [new storage row format](https://github.com/pingcap/tidb/blob/master/docs/design/2018-07-19-row-format.md) version `2` is used by default to save new data. - If you upgrade from a TiDB version earlier than 4.0.0 to 4.0.0, the format version is not changed, and TiDB continues to use the old format of version `1` to write data to the table, which means that **only newly created clusters use the new data format by default**. - Note that modifying this variable does not affect the old data that has been saved, but applies the corresponding version format only to the newly written data after modifying this variable. @@ -1077,20 +1129,20 @@ SET tidb_query_log_max_len = 20 ### tidb_scatter_region - Scope: GLOBAL -- Default value: OFF +- Default value: `OFF` - By default, Regions are split for a new table when it is being created in TiDB. After this variable is enabled, the newly split Regions are scattered immediately during the execution of the `CREATE TABLE` statement. This applies to the scenario where data need to be written in batches right after the tables are created in batches, because the newly split Regions can be scattered in TiKV beforehand and do not have to wait to be scheduled by PD. To ensure the continuous stability of writing data in batches, the `CREATE TABLE` statement returns success only after the Regions are successfully scattered. This makes the statement's execution time multiple times longer than that when you disable this variable. ### tidb_skip_ascii_check New in v5.0 - Scope: SESSION | GLOBAL -- Default value: OFF +- Default value: `OFF` - This variable is used to set whether to skip ASCII validation. - Validating ASCII characters affects the performance. When you are sure that the input characters are valid ASCII characters, you can set the variable value to `ON`. ### tidb_skip_isolation_level_check - Scope: SESSION | GLOBAL -- Default value: OFF +- Default value: `OFF` - After this switch is enabled, if an isolation level unsupported by TiDB is assigned to `tx_isolation`, no error is reported. This helps improve compatibility with applications that set (but do not depend on) a different isolation level. ```sql @@ -1106,14 +1158,16 @@ Query OK, 0 rows affected, 1 warning (0.00 sec) ### tidb_skip_utf8_check - Scope: SESSION | GLOBAL -- Default value: OFF +- Default value: `OFF` - This variable is used to set whether to skip UTF-8 validation. - Validating UTF-8 characters affects the performance. When you are sure that the input characters are valid UTF-8 characters, you can set the variable value to `ON`. ### tidb_slow_log_threshold - Scope: INSTANCE -- Default value: 300ms +- 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. Usage example: @@ -1137,51 +1191,49 @@ SET tidb_slow_log_threshold = 200; ### tidb_stmt_summary_history_size New in v4.0 - Scope: SESSION | GLOBAL -- Default value: 24 (the value of the default configuration file) -- Minimum value: 0 -- Maximum value: 255 +- Default value: `24` +- Range: `[0, 255]` - This variable is used to set the history capacity of the statement summary. ### tidb_stmt_summary_internal_query New in v4.0 - Scope: SESSION | GLOBAL -- Default value: 0 (the value of the default configuration file) +- Default value: `OFF` - This variable is used to control whether to include the SQL information of TiDB in the statement summary. ### tidb_stmt_summary_max_sql_length New in v4.0 - Scope: SESSION | GLOBAL -- Default value: 4096 (the value of the default configuration file) -- Minimum value: 0 -- Maximum value: 2147483647 +- Default value: `4096` +- Range: `[0, 2147483647]` - This variable is used to control the length of the SQL string in the statement summary. ### tidb_stmt_summary_max_stmt_count New in v4.0 - Scope: SESSION | GLOBAL -- Default value: 200 (the value of the default configuration file) -- Minimum value: 0 -- Maximum value: 32767 +- Default value: `200` +- Range: `[1, 32767]` - This variable is used to set the maximum number of statements that the statement summary stores in memory. ### tidb_stmt_summary_refresh_interval New in v4.0 - Scope: SESSION | GLOBAL -- Default value: 1800 (the value of the default configuration file) -- Minimum value: 1 -- Maximum value: 2147483647 +- Default value: `1800` +- Range: `[1, 2147483647]` - This variable is used to set the refresh time of the statement summary. The unit is second. ### tidb_store_limit New in v3.0.4 and v4.0 - Scope: INSTANCE | GLOBAL -- Default value: 0 +- Default value: `0` +- 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_txn_mode - Scope: SESSION | GLOBAL -- Default value: "pessimistic" +- Default value: `pessimistic` +- Possible values: `pessimistic`, `optimistic` - This variable is used to set the transaction mode. TiDB 3.0 supports the pessimistic transactions. Since TiDB 3.0.8, the [pessimistic transaction mode](/pessimistic-transaction.md) is enabled by default. - If you upgrade TiDB from v3.0.7 or earlier versions to v3.0.8 or later versions, the default transaction mode does not change. **Only the newly created clusters use the pessimistic transaction mode by default**. - If this variable is set to "optimistic" or "", TiDB uses the [optimistic transaction mode](/optimistic-transaction.md). @@ -1189,13 +1241,13 @@ SET tidb_slow_log_threshold = 200; ### tidb_use_plan_baselines New in v4.0 - Scope: SESSION | GLOBAL -- Default value: ON +- Default value: `ON` - This variable is used to control whether to enable the execution plan binding feature. It is enabled by default, and can be disabled by assigning the `OFF` value. For the use of the execution plan binding, see [Execution Plan Binding](/sql-plan-management.md#create-a-binding). ### tidb_wait_split_region_finish - Scope: SESSION -- Default value: ON +- Default value: `ON` - It usually takes a long time to scatter Regions, which is determined by PD scheduling and TiKV loads. This variable is used to set whether to return the result to the client after all Regions are scattered completely when the `SPLIT REGION` statement is being executed: - `ON` requires that the `SPLIT REGIONS` statement waits until all Regions are scattered. - `OFF` permits the `SPLIT REGIONS` statement to return before finishing scattering all Regions. @@ -1204,7 +1256,8 @@ SET tidb_slow_log_threshold = 200; ### tidb_wait_split_region_timeout - Scope: SESSION -- Default value: 300 +- Default value: `300` +- Range: `[1, 2147483647]` - This variable is used to set the timeout for executing the `SPLIT REGION` statement. The unit is second. If a statement is not executed completely within the specified time value, a timeout error is returned. ### tidb_window_concurrency New in v4.0 @@ -1214,21 +1267,23 @@ SET tidb_slow_log_threshold = 200; > Since v5.0, this variable is deprecated. Instead, use [`tidb_executor_concurrency`](#tidb_executor_concurrency-new-in-v50) for setting. - Scope: SESSION | GLOBAL -- Default value: -1 +- Default value: `-1` +- Range: `[1, 2147483647]` - This variable is used to set the concurrency degree of the window operator. - A value of `-1` means that the value of `tidb_executor_concurrency` will be used instead. ### time_zone - Scope: SESSION | GLOBAL -- Default value: SYSTEM +- Default value: `SYSTEM` - This variable returns the current time zone. Values can be specified as either an offset such as '-8:00' or a named zone 'America/Los_Angeles'. - The value `SYSTEM` means that the time zone should be the same as the system host, which is available via the [`system_time_zone`](#system_time_zone) variable. ### transaction_isolation - Scope: SESSION | GLOBAL -- Default value: REPEATABLE-READ +- Default value: `REPEATABLE-READ` +- Possible values: `READ-UNCOMMITTED`, `READ-COMMITTED`, `REPEATABLE-READ`, `SERIALIZABLE` - This variable sets the transaction isolation. TiDB advertises `REPEATABLE-READ` for compatibility with MySQL, but the actual isolation level is Snapshot Isolation. See [transaction isolation levels](/transaction-isolation-levels.md) for further details. ### tx_isolation @@ -1238,7 +1293,7 @@ This variable is an alias for _transaction_isolation_. ### version - Scope: NONE -- Default value: 5.7.25-TiDB-(tidb version) +- Default value: `5.7.25-TiDB-(tidb version)` - This variable returns the MySQL version, followed by the TiDB version. For example '5.7.25-TiDB-v4.0.0-beta.2-716-g25e003253'. ### version_comment @@ -1250,8 +1305,10 @@ This variable is an alias for _transaction_isolation_. ### wait_timeout - Scope: SESSION | GLOBAL -- Default value: 0 -- This variable controls the idle timeout of user sessions in seconds. A zero-value means unlimited. +- Default value: `0` +- Range: `[0, 31536000]` +- Unit: Seconds +- This variable controls the idle timeout of user sessions. A zero-value means unlimited. ### warning_count @@ -1262,5 +1319,5 @@ This variable is an alias for _transaction_isolation_. ### windowing_use_high_precision - Scope: SESSION | GLOBAL -- Default value: ON +- Default value: `ON` - This variable controls whether to use the high precision mode when computing the window functions.