Skip to content

Commit

Permalink
Update system variables for correctness (#6224)
Browse files Browse the repository at this point in the history
  • Loading branch information
morgo authored Sep 10, 2021
1 parent 380d0df commit f42e8fd
Showing 1 changed file with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -277,8 +278,8 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a
### tidb_analyze_version <span class="version-mark">New in v5.1.0</span>

- 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).

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -680,7 +681,8 @@ Query OK, 0 rows affected (0.09 sec)
### tidb_enforce_mpp <span class="version-mark">New in v5.1</span>

- 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`.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 <span class="version-mark">New in v5.0</span>

- Scope: SESSION | GLOBAL
Expand Down

0 comments on commit f42e8fd

Please sign in to comment.