Skip to content

Commit 05035d6

Browse files
qw4990TomShawn
authored andcommitted
This is an automated cherry-pick of pingcap#9943
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
1 parent adde294 commit 05035d6

File tree

1 file changed

+147
-0
lines changed

1 file changed

+147
-0
lines changed

system-variables.md

+147
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,38 @@ This variable is an alias for `last_insert_id`.
363363
>
364364
> 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.
365365
366+
### max_prepared_stmt_count
367+
368+
- Scope: GLOBAL
369+
- Persists to cluster: Yes
370+
- Type: Integer
371+
- Default value: `-1`
372+
- Range: `[-1, 1048576]`
373+
- Specifies the maximum number of [`PREPARE`](/sql-statements/sql-statement-prepare.md) statements in a session.
374+
- The value of `-1` means no limit on the maximum number of `PREPARE` statements in a session.
375+
- If you set the variable to a value that exceeds the upper limit `1048576`, `1048576` is used instead:
376+
377+
```sql
378+
mysql> SET GLOBAL max_prepared_stmt_count = 1048577;
379+
Query OK, 0 rows affected, 1 warning (0.01 sec)
380+
381+
mysql> SHOW WARNINGS;
382+
+---------+------+--------------------------------------------------------------+
383+
| Level | Code | Message |
384+
+---------+------+--------------------------------------------------------------+
385+
| Warning | 1292 | Truncated incorrect max_prepared_stmt_count value: '1048577' |
386+
+---------+------+--------------------------------------------------------------+
387+
1 row in set (0.00 sec)
388+
389+
mysql> SHOW GLOBAL VARIABLES LIKE 'max_prepared_stmt_count';
390+
+-------------------------+---------+
391+
| Variable_name | Value |
392+
+-------------------------+---------+
393+
| max_prepared_stmt_count | 1048576 |
394+
+-------------------------+---------+
395+
1 row in set (0.00 sec)
396+
```
397+
366398
### plugin_dir
367399

368400
- Scope: GLOBAL
@@ -1174,6 +1206,14 @@ This variable is associated with a feature available since v6.2.0 and not usable
11741206
- Since v6.1.0, the [Join Reorder](/join-reorder.md) algorithm of TiDB supports Outer Join. This variable controls the support behavior. The default value is `OFF`, which means the Join Reorder's support for Outer Join is disabled by default.
11751207
- For a cluster upgraded from a version earlier than v6.1.0, the default value is `OFF`. For a cluster upgraded from v6.1.0, the default value is `ON`.
11761208
1209+
### tidb_enable_ordered_result_mode
1210+
1211+
- Scope: SESSION | GLOBAL
1212+
- Persists to cluster: Yes
1213+
- Default value: `OFF`
1214+
- Specifies whether to sort the final output result automatically.
1215+
- 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)`.
1216+
11771217
### tidb_enable_paging <span class="version-mark">New in v5.4.0</span>
11781218
11791219
- Scope: SESSION | GLOBAL
@@ -2007,6 +2047,35 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified
20072047
- 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.
20082048
- When the aggregate operation is slow in query, you can set the variable value to ON.
20092049
2050+
### tidb_opt_cartesian_bcj
2051+
2052+
- Scope: SESSION | GLOBAL
2053+
- Persists to cluster: YES
2054+
- Type: Integer
2055+
- Default value: `1`
2056+
- Range: `[0, 2]`
2057+
- Indicates whether to allow the Broadcast Cartesian Join.
2058+
- `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.
2059+
- This variable is internally used in TiDB, and it is **NOT** recommended to modify its value.
2060+
2061+
### tidb_opt_concurrency_factor
2062+
2063+
- Scope: SESSION | GLOBAL
2064+
- Persists to cluster: YES
2065+
- Type: Float
2066+
- Range: `[0, 2147483647]`
2067+
- Default value: `3.0`
2068+
- 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.
2069+
2070+
### tidb_opt_cop_cpu_factor
2071+
2072+
- Scope: SESSION | GLOBAL
2073+
- Persists to cluster: YES
2074+
- Type: Float
2075+
- Range: `[0, 2147483647]`
2076+
- Default value: `3.0`
2077+
- 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.
2078+
20102079
### tidb_opt_correlation_exp_factor
20112080
20122081
- Scope: SESSION | GLOBAL
@@ -2029,6 +2098,33 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified
20292098
- Range: `[0, 1]`
20302099
- 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.
20312100
2101+
### tidb_opt_cpu_factor
2102+
2103+
- Scope: SESSION | GLOBAL
2104+
- Persists to cluster: YES
2105+
- Type: Float
2106+
- Range: `[0, 2147483647]`
2107+
- Default value: `3.0`
2108+
- 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.
2109+
2110+
### tidb_opt_desc_scan_factor
2111+
2112+
- Scope: SESSION | GLOBAL
2113+
- Persists to cluster: YES
2114+
- Type: Float
2115+
- Range: `[0, 2147483647]`
2116+
- Default value: `3.0`
2117+
- 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.
2118+
2119+
### tidb_opt_disk_factor
2120+
2121+
- Scope: SESSION | GLOBAL
2122+
- Persists to cluster: YES
2123+
- Type: Float
2124+
- Range: `[0, 2147483647]`
2125+
- Default value: `1.5`
2126+
- 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.
2127+
20322128
### tidb_opt_distinct_agg_push_down
20332129
20342130
- Scope: SESSION
@@ -2108,6 +2204,35 @@ mysql> desc select count(distinct a) from test.t;
21082204
- This variable is used to set the threshold that determines whether to push the Limit or TopN operator down to TiKV.
21092205
- 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.
21102206
2207+
<<<<<<< HEAD
2208+
=======
2209+
### tidb_opt_memory_factor
2210+
2211+
- Scope: SESSION | GLOBAL
2212+
- Persists to cluster: YES
2213+
- Type: Float
2214+
- Range: `[0, 2147483647]`
2215+
- Default value: `0.001`
2216+
- 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.
2217+
2218+
### tidb_opt_mpp_outer_join_fixed_build_side <span class="version-mark">New in v5.1.0</span>
2219+
2220+
- Scope: SESSION | GLOBAL
2221+
- Persists to cluster: Yes
2222+
- Type: Boolean
2223+
- Default value: `ON`
2224+
- When the variable value is `ON`, the left join operator always uses inner table as the build side and the right join operator always uses outer table as the build side. If you set the value to `OFF`, the outer join operator can use either side of the tables as the build side.
2225+
2226+
### tidb_opt_network_factor
2227+
2228+
- Scope: SESSION | GLOBAL
2229+
- Persists to cluster: YES
2230+
- Type: Float
2231+
- Range: `[0, 2147483647]`
2232+
- Default value: `1.0`
2233+
- 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.
2234+
2235+
>>>>>>> 44108aaa6 (planner: add docs for some variables (#9943))
21112236
### tidb_opt_prefer_range_scan <span class="version-mark">New in v5.0</span>
21122237
21132238
- Scope: SESSION | GLOBAL
@@ -2143,7 +2268,29 @@ explain select * from t where age=5;
21432268
21442269
### tidb_opt_write_row_id
21452270
2271+
<<<<<<< HEAD
21462272
<CustomContent platform="tidb-cloud">
2273+
=======
2274+
### tidb_opt_scan_factor
2275+
2276+
- Scope: SESSION | GLOBAL
2277+
- Persists to cluster: YES
2278+
- Type: Float
2279+
- Range: `[0, 2147483647]`
2280+
- Default value: `1.5`
2281+
- 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.
2282+
2283+
### tidb_opt_seek_factor
2284+
2285+
- Scope: SESSION | GLOBAL
2286+
- Persists to cluster: YES
2287+
- Type: Float
2288+
- Range: `[0, 2147483647]`
2289+
- Default value: `20`
2290+
- 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.
2291+
2292+
### tidb_opt_skew_distinct_agg <span class="version-mark">New in v6.2.0</span>
2293+
>>>>>>> 44108aaa6 (planner: add docs for some variables (#9943))
21472294
21482295
> **Note:**
21492296
>

0 commit comments

Comments
 (0)