From f42e8fde873f7dbf6d629b2a021ff1a8aa7c7a0f Mon Sep 17 00:00:00 2001 From: Morgan Tocker Date: Fri, 10 Sep 2021 00:24:39 -0600 Subject: [PATCH] Update system variables for correctness (#6224) --- system-variables.md | 50 +++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/system-variables.md b/system-variables.md index a732e697d2501..c442f18ce77e4 100644 --- a/system-variables.md +++ b/system-variables.md @@ -128,19 +128,20 @@ mysql> SELECT * FROM t1; - This variable indicates the location where data is stored. This location can be a local path or point to a PD server if the data is stored on TiKV. - A value in the format of `ip_address:port` indicates the PD server that TiDB connects to on startup. +### ddl_slow_threshold + +- Scope: INSTANCE +- Default value: `300` +- DDL operations whose execution time exceeds the threshold value are output to the log. The unit is millisecond. + ### default_authentication_plugin - Scope: GLOBAL - Default value: `mysql_native_password` +- Possible values: `mysql_native_password`, `caching_sha2_password` - This variable sets the authentication method that the server advertises when the server-client connection is being established. Possible values for this variable are documented in [Authentication plugin status](/security-compatibility-with-mysql.md#authentication-plugin-status). - Value options: `mysql_native_password` and `caching_sha2_password`. For more details, see [Authentication plugin status](/security-compatibility-with-mysql.md#authentication-plugin-status). -### ddl_slow_threshold - -- Scope: INSTANCE -- 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: SESSION | GLOBAL @@ -189,7 +190,7 @@ mysql> SELECT * FROM t1; ### license - Scope: NONE -- Default value: Apache License 2.0 +- Default value: `Apache License 2.0` - This variable indicates the license of your TiDB server installation. ### max_execution_time @@ -277,8 +278,8 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a ### tidb_analyze_version New in v5.1.0 - Scope: SESSION | GLOBAL -- Value options: `1` and `2` - Default value: `2` +- Range: `[1, 2]` - Controls how TiDB collects statistics. - In versions before v5.1.0, the default value of this variable is `1`. In v5.1.0, the default value of this variable is `2`, which serves as an experimental feature. For detailed introduction, see [Introduction to Statistics](/statistics.md). @@ -578,7 +579,7 @@ 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 +- Scope: SESSION | GLOBAL - Default value: `OFF` - This variable is used to set whether to enable the `LIST (COLUMNS) TABLE PARTITION` feature. @@ -680,7 +681,8 @@ Query OK, 0 rows affected (0.09 sec) ### tidb_enforce_mpp New in v5.1 - Scope: SESSION -- Default value: `OFF`. To change this default value, modify the [`performance.enforce-mpp`](/tidb-configuration-file.md#enforce-mpp) configuration value. +- Default value: `OFF` +- To change this default value, modify the [`performance.enforce-mpp`](/tidb-configuration-file.md#enforce-mpp) configuration value. - Controls whether to ignore the optimizer's cost estimation and to forcibly use TiFlash's MPP mode for query execution. The value options are as follows: - `0` or `OFF`, which means that the MPP mode is not forcibly used (by default). - `1` or `ON`, which means that the cost estimation is ignored and the MPP mode is forcibly used. Note that this setting only takes effect when `tidb_allow_mpp=true`. @@ -1015,20 +1017,6 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - 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_limit_push_down_threshold - -- Scope: SESSION | GLOBAL -- Default value: `100` -- Range: `[0, 2147483647]` -- This variable is used to set the threshold that determines whether to push the Limit or TopN operator down to TiKV. -- If the value of the Limit or TopN operator is smaller than or equal to this threshold, these operators are forcibly pushed down to TiKV. This variable resolves the issue that the Limit or TopN operator cannot be pushed down to TiKV partly due to wrong estimation. - -### tidb_opt_enable_correlation_adjustment - -- Scope: SESSION | GLOBAL -- Default value: `ON` -- This variable is used to control whether the optimizer estimates the number of rows based on column order correlation - ### tidb_opt_correlation_exp_factor - Scope: SESSION | GLOBAL @@ -1081,6 +1069,12 @@ mysql> desc select count(distinct a) from test.t; 4 rows in set (0.00 sec) ``` +### tidb_opt_enable_correlation_adjustment + +- Scope: SESSION | GLOBAL +- Default value: `ON` +- This variable is used to control whether the optimizer estimates the number of rows based on column order correlation + ### tidb_opt_insubq_to_join_and_agg - Scope: SESSION | GLOBAL @@ -1104,6 +1098,14 @@ mysql> desc select count(distinct a) from test.t; select * from t, t1 where t.a=t1.a ``` +### tidb_opt_limit_push_down_threshold + +- Scope: SESSION | GLOBAL +- Default value: `100` +- Range: `[0, 2147483647]` +- This variable is used to set the threshold that determines whether to push the Limit or TopN operator down to TiKV. +- If the value of the Limit or TopN operator is smaller than or equal to this threshold, these operators are forcibly pushed down to TiKV. This variable resolves the issue that the Limit or TopN operator cannot be pushed down to TiKV partly due to wrong estimation. + ### tidb_opt_prefer_range_scan New in v5.0 - Scope: SESSION | GLOBAL