You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: system-variables.md
+147
Original file line number
Diff line number
Diff line change
@@ -363,6 +363,38 @@ This variable is an alias for `last_insert_id`.
363
363
>
364
364
> 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.
365
365
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;
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 inset (0.00 sec)
396
+
```
397
+
366
398
### plugin_dir
367
399
368
400
- Scope: GLOBAL
@@ -1174,6 +1206,14 @@ This variable is associated with a feature available since v6.2.0 and not usable
1174
1206
- 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.
1175
1207
- 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`.
1176
1208
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
+
1177
1217
### tidb_enable_paging <span class="version-mark">New in v5.4.0</span>
1178
1218
1179
1219
- Scope: SESSION | GLOBAL
@@ -2007,6 +2047,35 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified
2007
2047
- 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.
2008
2048
- When the aggregate operation is slow in query, you can set the variable value to ON.
2009
2049
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
+
2010
2079
### tidb_opt_correlation_exp_factor
2011
2080
2012
2081
- Scope: SESSION | GLOBAL
@@ -2029,6 +2098,33 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified
2029
2098
- Range: `[0, 1]`
2030
2099
- 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.
2031
2100
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 fromor 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
+
2032
2128
### tidb_opt_distinct_agg_push_down
2033
2129
2034
2130
- Scope: SESSION
@@ -2108,6 +2204,35 @@ mysql> desc select count(distinct a) from test.t;
2108
2204
- This variable is used to set the threshold that determines whether to push the Limitor TopN operator down to TiKV.
2109
2205
- If the value of the Limitor 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 Limitor TopN operator cannot be pushed down to TiKV partly due to wrong estimation.
2110
2206
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))
2111
2236
### tidb_opt_prefer_range_scan <span class="version-mark">New in v5.0</span>
2112
2237
2113
2238
- Scope: SESSION | GLOBAL
@@ -2143,7 +2268,29 @@ explain select * from t where age=5;
2143
2268
2144
2269
### tidb_opt_write_row_id
2145
2270
2271
+
<<<<<<< HEAD
2146
2272
<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))
0 commit comments