Skip to content

Commit c8dd0f2

Browse files
authored
system-variables: add optimizer cost factors (#20748) (#21602)
1 parent ab89fa1 commit c8dd0f2

1 file changed

Lines changed: 213 additions & 9 deletions

File tree

system-variables.md

Lines changed: 213 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4114,7 +4114,7 @@ As shown in this diagram, when [`tidb_enable_paging`](#tidb_enable_paging-new-in
41144114
- Type: Float
41154115
- Range: `[0, 18446744073709551615]`
41164116
- Default value: `3.0`
4117-
- 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.
4117+
- Indicates the CPU cost of starting a Golang goroutine in TiDB. This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
41184118

41194119
### tidb_opt_copcpu_factor
41204120

@@ -4124,7 +4124,7 @@ As shown in this diagram, when [`tidb_enable_paging`](#tidb_enable_paging-new-in
41244124
- Type: Float
41254125
- Range: `[0, 18446744073709551615]`
41264126
- Default value: `3.0`
4127-
- 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.
4127+
- Indicates the CPU cost for TiKV Coprocessor to process one row. This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
41284128

41294129
### tidb_opt_correlation_exp_factor
41304130

@@ -4158,7 +4158,7 @@ As shown in this diagram, when [`tidb_enable_paging`](#tidb_enable_paging-new-in
41584158
- Type: Float
41594159
- Range: `[0, 2147483647]`
41604160
- Default value: `3.0`
4161-
- 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.
4161+
- Indicates the CPU cost for TiDB to process one row. This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
41624162

41634163
### `tidb_opt_derive_topn` <span class="version-mark">New in v7.0.0</span>
41644164

@@ -4177,7 +4177,7 @@ As shown in this diagram, when [`tidb_enable_paging`](#tidb_enable_paging-new-in
41774177
- Type: Float
41784178
- Range: `[0, 18446744073709551615]`
41794179
- Default value: `3.0`
4180-
- 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.
4180+
- Indicates the cost for TiKV to scan one row from the disk in descending order. This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
41814181

41824182
### tidb_opt_disk_factor
41834183

@@ -4187,7 +4187,7 @@ As shown in this diagram, when [`tidb_enable_paging`](#tidb_enable_paging-new-in
41874187
- Type: Float
41884188
- Range: `[0, 18446744073709551615]`
41894189
- Default value: `1.5`
4190-
- 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.
4190+
- Indicates the I/O cost for TiDB to read or write one byte of data from or to the temporary disk. This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
41914191

41924192
### tidb_opt_distinct_agg_push_down
41934193

@@ -4392,7 +4392,7 @@ mysql> desc select count(distinct a) from test.t;
43924392
- Type: Float
43934393
- Range: `[0, 2147483647]`
43944394
- Default value: `0.001`
4395-
- 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.
4395+
- Indicates the memory cost for TiDB to store one row. This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
43964396

43974397
### tidb_opt_mpp_outer_join_fixed_build_side <span class="version-mark">New in v5.1.0</span>
43984398

@@ -4411,7 +4411,7 @@ mysql> desc select count(distinct a) from test.t;
44114411
- Type: Float
44124412
- Range: `[0, 2147483647]`
44134413
- Default value: `1.0`
4414-
- 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.
4414+
- Indicates the net cost of transferring 1 byte of data through the network. This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
44154415

44164416
### tidb_opt_objective <span class="version-mark">New in v7.4.0</span>
44174417

@@ -4825,7 +4825,7 @@ SHOW WARNINGS;
48254825
- Type: Float
48264826
- Range: `[0, 2147483647]`
48274827
- Default value: `1.5`
4828-
- 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.
4828+
- Indicates the cost for TiKV to scan one row of data from the disk in ascending order. This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
48294829
48304830
### tidb_opt_seek_factor
48314831
@@ -4835,7 +4835,7 @@ SHOW WARNINGS;
48354835
- Type: Float
48364836
- Range: `[0, 2147483647]`
48374837
- Default value: `20`
4838-
- 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.
4838+
- Indicates the start-up cost for TiDB to request data from TiKV. This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
48394839
48404840
### tidb_opt_skew_distinct_agg <span class="version-mark">New in v6.2.0</span>
48414841
@@ -4890,6 +4890,210 @@ SHOW WARNINGS;
48904890
- Default value: `OFF`
48914891
- This variable is used to control whether to allow `INSERT`, `REPLACE`, and `UPDATE` statements to operate on the `_tidb_rowid` column. This variable can be used only when you import data using TiDB tools.
48924892
4893+
### tidb_opt_hash_agg_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
4894+
4895+
> **Warning:**
4896+
>
4897+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
4898+
4899+
- Scope: SESSION | GLOBAL
4900+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
4901+
- Type: Float
4902+
- Range: `[0, 2147483647]`
4903+
- Default value: `1`
4904+
4905+
### tidb_opt_hash_join_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
4906+
4907+
> **Warning:**
4908+
>
4909+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
4910+
4911+
- Scope: SESSION | GLOBAL
4912+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
4913+
- Type: Float
4914+
- Range: `[0, 2147483647]`
4915+
- Default value: `1`
4916+
4917+
### tidb_opt_index_join_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
4918+
4919+
> **Warning:**
4920+
>
4921+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
4922+
4923+
- Scope: SESSION | GLOBAL
4924+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
4925+
- Type: Float
4926+
- Range: `[0, 2147483647]`
4927+
- Default value: `1`
4928+
4929+
### tidb_opt_index_lookup_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
4930+
4931+
> **Warning:**
4932+
>
4933+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
4934+
4935+
- Scope: SESSION | GLOBAL
4936+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
4937+
- Type: Float
4938+
- Range: `[0, 2147483647]`
4939+
- Default value: `1`
4940+
4941+
### tidb_opt_index_merge_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
4942+
4943+
> **Warning:**
4944+
>
4945+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
4946+
4947+
- Scope: SESSION | GLOBAL
4948+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
4949+
- Type: Float
4950+
- Range: `[0, 2147483647]`
4951+
- Default value: `1`
4952+
4953+
### tidb_opt_index_reader_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
4954+
4955+
> **Warning:**
4956+
>
4957+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
4958+
4959+
- Scope: SESSION | GLOBAL
4960+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
4961+
- Type: Float
4962+
- Range: `[0, 2147483647]`
4963+
- Default value: `1`
4964+
4965+
### tidb_opt_index_scan_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
4966+
4967+
> **Warning:**
4968+
>
4969+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
4970+
4971+
- Scope: SESSION | GLOBAL
4972+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
4973+
- Type: Float
4974+
- Range: `[0, 2147483647]`
4975+
- Default value: `1`
4976+
4977+
### tidb_opt_limit_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
4978+
4979+
> **Warning:**
4980+
>
4981+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
4982+
4983+
- Scope: SESSION | GLOBAL
4984+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
4985+
- Type: Float
4986+
- Range: `[0, 2147483647]`
4987+
- Default value: `1`
4988+
4989+
### tidb_opt_merge_join_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
4990+
4991+
> **Warning:**
4992+
>
4993+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
4994+
4995+
- Scope: SESSION | GLOBAL
4996+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
4997+
- Type: Float
4998+
- Range: `[0, 2147483647]`
4999+
- Default value: `1`
5000+
5001+
### tidb_opt_sort_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5002+
5003+
> **Warning:**
5004+
>
5005+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5006+
5007+
- Scope: SESSION | GLOBAL
5008+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5009+
- Type: Float
5010+
- Range: `[0, 2147483647]`
5011+
- Default value: `1`
5012+
5013+
### tidb_opt_stream_agg_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5014+
5015+
> **Warning:**
5016+
>
5017+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5018+
5019+
- Scope: SESSION | GLOBAL
5020+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5021+
- Type: Float
5022+
- Range: `[0, 2147483647]`
5023+
- Default value: `1`
5024+
5025+
### tidb_opt_table_full_scan_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5026+
5027+
> **Warning:**
5028+
>
5029+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5030+
5031+
- Scope: SESSION | GLOBAL
5032+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5033+
- Type: Float
5034+
- Range: `[0, 2147483647]`
5035+
- Default value: `1`
5036+
5037+
### tidb_opt_table_range_scan_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5038+
5039+
> **Warning:**
5040+
>
5041+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5042+
5043+
- Scope: SESSION | GLOBAL
5044+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5045+
- Type: Float
5046+
- Range: `[0, 2147483647]`
5047+
- Default value: `1`
5048+
5049+
### tidb_opt_table_reader_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5050+
5051+
> **Warning:**
5052+
>
5053+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5054+
5055+
- Scope: SESSION | GLOBAL
5056+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5057+
- Type: Float
5058+
- Range: `[0, 2147483647]`
5059+
- Default value: `1`
5060+
5061+
### tidb_opt_table_rowid_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5062+
5063+
> **Warning:**
5064+
>
5065+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5066+
5067+
- Scope: SESSION | GLOBAL
5068+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5069+
- Type: Float
5070+
- Range: `[0, 2147483647]`
5071+
- Default value: `1`
5072+
5073+
### tidb_opt_table_tiflash_scan_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5074+
5075+
> **Warning:**
5076+
>
5077+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5078+
5079+
- Scope: SESSION | GLOBAL
5080+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5081+
- Type: Float
5082+
- Range: `[0, 2147483647]`
5083+
- Default value: `1`
5084+
5085+
### tidb_opt_topn_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5086+
5087+
> **Warning:**
5088+
>
5089+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5090+
5091+
- Scope: SESSION | GLOBAL
5092+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5093+
- Type: Float
5094+
- Range: `[0, 2147483647]`
5095+
- Default value: `1`
5096+
48935097
### tidb_optimizer_selectivity_level
48945098
48955099
- Scope: SESSION

0 commit comments

Comments
 (0)