Skip to content

Commit

Permalink
planner: add docs for some variables (#10906)
Browse files Browse the repository at this point in the history
  • Loading branch information
qw4990 authored Oct 21, 2022
1 parent 9073ce9 commit 925cb1e
Showing 1 changed file with 108 additions and 0 deletions.
108 changes: 108 additions & 0 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -2344,6 +2344,15 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified
- 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_concurrency_factor_v2
- 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_copcpu_factor
- Scope: SESSION | GLOBAL
Expand All @@ -2353,6 +2362,15 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified
- 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_copcpu_factor_v2
- Scope: SESSION | GLOBAL
- Persists to cluster: YES
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `30.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
Expand Down Expand Up @@ -2384,6 +2402,15 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified
- 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_cpu_factor_v2
- Scope: SESSION | GLOBAL
- Persists to cluster: YES
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `30.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_factor
- Scope: SESSION | GLOBAL
Expand All @@ -2393,6 +2420,15 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified
- 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_desc_factor_v2
- Scope: SESSION | GLOBAL
- Persists to cluster: YES
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `150.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
Expand All @@ -2402,6 +2438,15 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified
- 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_disk_factor_v2
- 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
Expand Down Expand Up @@ -2499,6 +2544,15 @@ mysql> desc select count(distinct a) from test.t;
- 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_memory_factor_v2
- 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
Expand All @@ -2516,6 +2570,15 @@ mysql> desc select count(distinct a) from test.t;
- 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_network_factor_v2
- Scope: SESSION | GLOBAL
- Persists to cluster: YES
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `4.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
Expand Down Expand Up @@ -2566,6 +2629,15 @@ explain select * from t where age=5;
- 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_scan_factor_v2
- Scope: SESSION | GLOBAL
- Persists to cluster: YES
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `100.0`
- 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
Expand All @@ -2575,6 +2647,15 @@ explain select * from t where age=5;
- 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_seek_factor_v2
- Scope: SESSION | GLOBAL
- Persists to cluster: YES
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `9500000`
- 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:**
Expand All @@ -2587,6 +2668,33 @@ explain select * from t where age=5;
- Default value: `OFF`
- This variable sets whether the optimizer rewrites the aggregate functions with `DISTINCT` to the two-level aggregate functions, such as rewriting `SELECT b, COUNT(DISTINCT a) FROM t GROUP BY b` to `SELECT b, COUNT(a) FROM (SELECT b, a FROM t GROUP BY b, a) t GROUP BY b`. When the aggregation column has serious skew and the `DISTINCT` column has many different values, this rewriting can avoid the data skew in the query execution and improve the query performance.
### tidb_opt_tiflash_concurrency_factor
- Scope: SESSION | GLOBAL
- Persists to cluster: YES
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `24.0`
- This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value.
### tidb_opt_tiflash_cpu_factor_v2
- Scope: SESSION | GLOBAL
- Persists to cluster: YES
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `2.0`
- Indicates the CPU cost for TiFlash 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_tiflash_scan_factor_v2
- Scope: SESSION | GLOBAL
- Persists to cluster: YES
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `15.0`
- Indicates the cost for TiFlash to scan one row from the disk. This variable is internally used in the [Cost Model](/cost-model.md), and it is **NOT** recommended to modify its value.
### tidb_opt_write_row_id
<CustomContent platform="tidb-cloud">
Expand Down

0 comments on commit 925cb1e

Please sign in to comment.