-
Notifications
You must be signed in to change notification settings - Fork 688
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
planner: add docs for some variables #9943
Changes from all commits
73c22dc
d700942
cbcc7ca
ea8e1c2
aa8d832
b8aab3e
ab89763
b77e6c2
fe0b085
a39e5d6
84cd867
59a8c2d
7e8ca88
3b8a5c9
eb3554f
4797be3
ac5fed6
458b49f
8ff4b80
a60c199
9affe1d
0f08d6e
d0f5d3c
4c2d1b7
efae50d
45631c9
7454a40
c6d981c
1eac2a8
94a4398
676a458
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -335,6 +335,38 @@ This variable is an alias for `last_insert_id`. | |
> | ||
> Unlike in MySQL, the `max_execution_time` system variable currently works on all kinds of statements in TiDB, not only restricted to the `SELECT` statement. The precision of the timeout value is roughly 100ms. This means the statement might not be terminated in accurate milliseconds as you specify. | ||
|
||
### max_prepared_stmt_count | ||
|
||
- Scope: GLOBAL | ||
- Persists to cluster: Yes | ||
- Type: Integer | ||
- Default value: `-1` | ||
- Range: `[-1, 1048576]` | ||
- Specifies the maximum number of [`PREPARE`](/sql-statements/sql-statement-prepare.md) statements in a session. | ||
- The value of `-1` means no limit on the maximum number of `PREPARE` statements in a session. | ||
- If you set the variable to a value that exceeds the upper limit `1048576`, `1048576` is used instead: | ||
|
||
```sql | ||
mysql> SET GLOBAL max_prepared_stmt_count = 1048577; | ||
Query OK, 0 rows affected, 1 warning (0.01 sec) | ||
|
||
mysql> SHOW WARNINGS; | ||
+---------+------+--------------------------------------------------------------+ | ||
| Level | Code | Message | | ||
+---------+------+--------------------------------------------------------------+ | ||
| Warning | 1292 | Truncated incorrect max_prepared_stmt_count value: '1048577' | | ||
+---------+------+--------------------------------------------------------------+ | ||
1 row in set (0.00 sec) | ||
|
||
mysql> SHOW GLOBAL VARIABLES LIKE 'max_prepared_stmt_count'; | ||
+-------------------------+---------+ | ||
| Variable_name | Value | | ||
+-------------------------+---------+ | ||
| max_prepared_stmt_count | 1048576 | | ||
+-------------------------+---------+ | ||
1 row in set (0.00 sec) | ||
``` | ||
|
||
### plugin_dir | ||
|
||
- Scope: GLOBAL | ||
|
@@ -1053,6 +1085,14 @@ Constraint checking is always performed in place for pessimistic transactions (d | |
- Since v6.1.0, the [Join Reorder](/join-reorder.md) algorithm of TiDB supports Outer Join. This variable controls the support behavior, and the default value is `ON`. | ||
- For a cluster upgraded from a version earlier than v6.1.0, the default value is still `TRUE`. | ||
|
||
### tidb_enable_ordered_result_mode | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Persists to cluster: Yes | ||
- Default value: `OFF` | ||
- Specifies whether to sort the final output result automatically. | ||
- For example, with this variable enabled, TiDB processes `SELECT a, MAX(b) FROM t GROUP BY a` as `SELECT a, MAX(b) FROM t GROUP BY a ORDER BY a, MAX(b)`. | ||
|
||
### tidb_enable_paging <span class="version-mark">New in v5.4.0</span> | ||
|
||
- Scope: SESSION | GLOBAL | ||
|
@@ -1724,6 +1764,35 @@ 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_cartesian_bcj | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Persists to cluster: YES | ||
- Type: Integer | ||
- Default value: `1` | ||
- Range: `[0, 2]` | ||
- Indicates whether to allow the Broadcast Cartesian Join. | ||
- `0` means that the Broadcast Cartesian Join is not allowed. `1` means that it is allowed based on [`tidb_broadcast_join_threshold_count`](#tidb_broadcast_join_threshold_count-new-in-v50). `2` means that it is always allowed even if the table size exceeds the threshold. | ||
- This variable is internally used in TiDB, and it is **NOT** recommended to modify its value. | ||
|
||
### tidb_opt_concurrency_factor | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Persists to cluster: YES | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `3.0` | ||
- Indicates the CPU cost of starting a Golang goroutine in TiDB. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
### tidb_opt_cop_cpu_factor | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect variable name. Fixed in #10782 |
||
|
||
- Scope: SESSION | GLOBAL | ||
- Persists to cluster: YES | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `3.0` | ||
- Indicates the CPU cost for TiKV Coprocessor to process one row. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
### tidb_opt_correlation_exp_factor | ||
|
||
- Scope: SESSION | GLOBAL | ||
|
@@ -1746,6 +1815,33 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified | |
- Range: `[0, 1]` | ||
- 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_cpu_factor | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Persists to cluster: YES | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `3.0` | ||
- Indicates the CPU cost for TiDB to process one row. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
### tidb_opt_desc_scan_factor | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect variable name. Fixed in #10782 |
||
|
||
- Scope: SESSION | GLOBAL | ||
- Persists to cluster: YES | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `3.0` | ||
- Indicates the cost for TiKV to scan one row from the disk in descending order. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
### tidb_opt_disk_factor | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Persists to cluster: YES | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1.5` | ||
- Indicates the I/O cost for TiDB to read or write one byte of data from or to the temporary disk. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
### tidb_opt_distinct_agg_push_down | ||
|
||
- Scope: SESSION | ||
|
@@ -1825,6 +1921,15 @@ mysql> desc select count(distinct a) from test.t; | |
- 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_memory_factor | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Persists to cluster: YES | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `0.001` | ||
- Indicates the memory cost for TiDB to store one row. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
### tidb_opt_mpp_outer_join_fixed_build_side <span class="version-mark">New in v5.1.0</span> | ||
|
||
- Scope: SESSION | GLOBAL | ||
|
@@ -1833,6 +1938,15 @@ mysql> desc select count(distinct a) from test.t; | |
- Default value: `ON` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect default value. Fixed in #10782. |
||
- Specifies whether to allow using outer table as the build side in outer join for TiFlash. | ||
|
||
### tidb_opt_network_factor | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Persists to cluster: YES | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1.0` | ||
- Indicates the net cost of transferring 1 byte of data through the network. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
### tidb_opt_prefer_range_scan <span class="version-mark">New in v5.0</span> | ||
|
||
- Scope: SESSION | GLOBAL | ||
|
@@ -1874,6 +1988,24 @@ explain select * from t where age=5; | |
- Default value: `OFF` | ||
- Specifies whether to allow the optimizer to push `Projection` down to the TiKV or TiFlash coprocessor. | ||
|
||
### tidb_opt_scan_factor | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Persists to cluster: YES | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1.5` | ||
- Indicates the cost for TiKV to scan one row of data from the disk in ascending order. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
### tidb_opt_seek_factor | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Persists to cluster: YES | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `20` | ||
- Indicates the start-up cost for TiDB to request data from TiKV. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
### tidb_opt_skew_distinct_agg <span class="version-mark">New in v6.2.0</span> | ||
|
||
> **Note:** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect variable name. Fixed in #10782