From 65c34fb98deedb0a74e40d8a5e204259042868bf Mon Sep 17 00:00:00 2001 From: Morgan Tocker Date: Thu, 27 May 2021 23:27:35 -0600 Subject: [PATCH 1/3] This is an automated cherry-pick of #5711 Signed-off-by: ti-chi-bot --- system-variables.md | 68 +++++++++++++++++------------ telemetry.md | 2 +- tidb-configuration-file.md | 2 +- tiflash/tune-tiflash-performance.md | 2 +- 4 files changed, 44 insertions(+), 30 deletions(-) diff --git a/system-variables.md b/system-variables.md index 7654d894586b8..75c1bf5a8585b 100644 --- a/system-variables.md +++ b/system-variables.md @@ -149,7 +149,7 @@ mysql> SELECT * FROM t1; - Default value: `ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION` - This variable controls a number of MySQL compatibility behaviors. See [SQL Mode](/sql-mode.md) for more information. -### sql_select_limit New in v4.0.2 version +### sql_select_limit New in v4.0.2 - Scope: SESSION | GLOBAL - Default value: `2^64 - 1` (18446744073709551615) @@ -161,7 +161,7 @@ mysql> SELECT * FROM t1; - Default value: (system dependent) - This variable shows the system time zone from when TiDB was first bootstrapped. See also [`time_zone`](#time_zone). -### tidb_allow_batch_cop New in v4.0 version +### tidb_allow_batch_cop New in v4.0 - Scope: SESSION | GLOBAL - Default value: 1 @@ -365,6 +365,17 @@ Constraint checking is always performed in place for pessimistic transactions (d - 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: `ON` for newly created clusters. If your cluster before upgrade was earlier than v5.0, the variable value defaults to `OFF` after the upgrade. +- 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:** +> +> - 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 @@ -390,6 +401,7 @@ Constraint checking is always performed in place for pessimistic transactions (d > - 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. +<<<<<<< HEAD ### tidb_enable_1pc New in v5.0 - Scope: SESSION | GLOBAL @@ -401,6 +413,8 @@ Constraint checking is always performed in place for pessimistic transactions (d > - 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. +======= +>>>>>>> c89a1f629 (system-variables: ensure alphabetical order (#5711)) ### tidb_enable_cascades_planner - Scope: SESSION | GLOBAL @@ -441,6 +455,16 @@ Constraint checking is always performed in place for pessimistic transactions (d - Default value: OFF - This variable is used to control whether to enable the index merge feature. +### tidb_enable_list_partition New in v5.0 + +> **Warning:** +> +> 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 +- 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 @@ -513,17 +537,7 @@ Query OK, 0 rows affected (0.09 sec) - `AUTO` functions the same way as `ON` does. - `OFF` indicates disabling the `TABLE PARTITION` feature. In this case, the syntax that creates a partition table can be executed, but the table created is not a partitioned one. -### tidb_enable_list_partition New in v5.0 - -> **Warning:** -> -> 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 -- This variable is used to set whether to enable the `LIST (COLUMNS) TABLE PARTITION` feature. - -### tidb_enable_telemetry New in v4.0.2 version +### tidb_enable_telemetry New in v4.0.2 - Scope: GLOBAL - Default value: ON @@ -783,13 +797,6 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Default value: 1024 - 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_query - -- Scope: SESSION -- Default value: 1 GB -- 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_mem_quota_apply_cache New in v5.0 - Scope: SESSION | GLOBAL @@ -797,6 +804,13 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - 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 +- 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 @@ -1031,6 +1045,13 @@ SET tidb_query_log_max_len = 20 - 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 +- 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 @@ -1054,13 +1075,6 @@ Query OK, 0 rows affected, 1 warning (0.00 sec) - 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_skip_ascii_check New in v5.0 - -- Scope: SESSION | GLOBAL -- 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_slow_log_threshold - Scope: INSTANCE diff --git a/telemetry.md b/telemetry.md index a0576d9a999bf..b43248d3473f0 100644 --- a/telemetry.md +++ b/telemetry.md @@ -135,7 +135,7 @@ See [Deploy TiDB Operator in Kubernetes](https://docs.pingcap.com/tidb-in-kubern ### Disable TiDB telemetry for deployed TiDB clusters -In existing TiDB clusters, you can also modify the system variable [`tidb_enable_telemetry`](/system-variables.md#tidb_enable_telemetry-new-in-v402-version) to dynamically disable the TiDB telemetry collection: +In existing TiDB clusters, you can also modify the system variable [`tidb_enable_telemetry`](/system-variables.md#tidb_enable_telemetry-new-in-v402) to dynamically disable the TiDB telemetry collection: {{< copyable "sql" >}} diff --git a/tidb-configuration-file.md b/tidb-configuration-file.md index e318ee0c15fc5..57d8edf884d9c 100644 --- a/tidb-configuration-file.md +++ b/tidb-configuration-file.md @@ -156,7 +156,7 @@ The TiDB configuration file supports more options than command-line parameters. - Enables or disables the telemetry collection in TiDB. - Default value: `true` -- When this configuration is set to `false` on all TiDB instances, the telemetry collection in TiDB is disabled and the [`tidb_enable_telemetry`](/system-variables.md#tidb_enable_telemetry-new-in-v402-version) system variable does not take effect. See [Telemetry](/telemetry.md) for details. +- When this configuration is set to `false` on all TiDB instances, the telemetry collection in TiDB is disabled and the [`tidb_enable_telemetry`](/system-variables.md#tidb_enable_telemetry-new-in-v402) system variable does not take effect. See [Telemetry](/telemetry.md) for details. ### `enable-tcp4-only` New in v5.0 diff --git a/tiflash/tune-tiflash-performance.md b/tiflash/tune-tiflash-performance.md index bf2bdf27d39a8..de8a951737535 100644 --- a/tiflash/tune-tiflash-performance.md +++ b/tiflash/tune-tiflash-performance.md @@ -23,7 +23,7 @@ If you want to save machine resources and have no requirement on isolation, you 2. Enable the super batch feature: - You can use the [`tidb_allow_batch_cop`](/system-variables.md#tidb_allow_batch_cop-new-in-v40-version) variable to set whether to merge Region requests when reading from TiFlash. + You can use the [`tidb_allow_batch_cop`](/system-variables.md#tidb_allow_batch_cop-new-in-v40) variable to set whether to merge Region requests when reading from TiFlash. When the number of Regions involved in the query is relatively large, try to set this variable to `1` (effective for coprocessor requests with `aggregation` operators that are pushed down to TiFlash), or set this variable to `2` (effective for all coprocessor requests that are pushed down to TiFlash). From 9e7b927dc9592b55131f4772c0012b771560a5ea Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Fri, 28 May 2021 13:40:07 +0800 Subject: [PATCH 2/3] Update system-variables.md --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 75c1bf5a8585b..7e7315577ca37 100644 --- a/system-variables.md +++ b/system-variables.md @@ -368,7 +368,7 @@ Constraint checking is always performed in place for pessimistic transactions (d ### tidb_enable_1pc New in v5.0 - Scope: SESSION | GLOBAL -- Default value: `ON` for newly created clusters. If your cluster before upgrade was earlier than v5.0, the variable value defaults to `OFF` after the upgrade. +- 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. - 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:** From 196ce5ca9149f4c9d5b00aad35ac6b42d05472f3 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Fri, 28 May 2021 13:40:48 +0800 Subject: [PATCH 3/3] Update system-variables.md --- system-variables.md | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/system-variables.md b/system-variables.md index 7e7315577ca37..c3e45d22fb79b 100644 --- a/system-variables.md +++ b/system-variables.md @@ -401,20 +401,6 @@ Constraint checking is always performed in place for pessimistic transactions (d > - 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. -<<<<<<< HEAD -### 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. -- 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:** -> -> - 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. - -======= ->>>>>>> c89a1f629 (system-variables: ensure alphabetical order (#5711)) ### tidb_enable_cascades_planner - Scope: SESSION | GLOBAL