Skip to content

Commit c7225fb

Browse files
system-variables: add optimizer cost factors (#20748)
1 parent f2df74d commit c7225fb

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
@@ -4156,7 +4156,7 @@ As shown in this diagram, when [`tidb_enable_paging`](#tidb_enable_paging-new-in
41564156
- Type: Float
41574157
- Range: `[0, 18446744073709551615]`
41584158
- Default value: `3.0`
4159-
- 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.
4159+
- 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.
41604160

41614161
### tidb_opt_copcpu_factor
41624162

@@ -4166,7 +4166,7 @@ As shown in this diagram, when [`tidb_enable_paging`](#tidb_enable_paging-new-in
41664166
- Type: Float
41674167
- Range: `[0, 18446744073709551615]`
41684168
- Default value: `3.0`
4169-
- 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.
4169+
- 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.
41704170

41714171
### tidb_opt_correlation_exp_factor
41724172

@@ -4200,7 +4200,7 @@ As shown in this diagram, when [`tidb_enable_paging`](#tidb_enable_paging-new-in
42004200
- Type: Float
42014201
- Range: `[0, 2147483647]`
42024202
- Default value: `3.0`
4203-
- 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.
4203+
- 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.
42044204

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

@@ -4219,7 +4219,7 @@ As shown in this diagram, when [`tidb_enable_paging`](#tidb_enable_paging-new-in
42194219
- Type: Float
42204220
- Range: `[0, 18446744073709551615]`
42214221
- Default value: `3.0`
4222-
- 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.
4222+
- 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.
42234223

42244224
### tidb_opt_disk_factor
42254225

@@ -4229,7 +4229,7 @@ As shown in this diagram, when [`tidb_enable_paging`](#tidb_enable_paging-new-in
42294229
- Type: Float
42304230
- Range: `[0, 18446744073709551615]`
42314231
- Default value: `1.5`
4232-
- 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.
4232+
- 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.
42334233

42344234
### tidb_opt_distinct_agg_push_down
42354235

@@ -4434,7 +4434,7 @@ mysql> desc select count(distinct a) from test.t;
44344434
- Type: Float
44354435
- Range: `[0, 2147483647]`
44364436
- Default value: `0.001`
4437-
- 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.
4437+
- 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.
44384438

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

@@ -4453,7 +4453,7 @@ mysql> desc select count(distinct a) from test.t;
44534453
- Type: Float
44544454
- Range: `[0, 2147483647]`
44554455
- Default value: `1.0`
4456-
- 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.
4456+
- 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.
44574457

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

@@ -4867,7 +4867,7 @@ SHOW WARNINGS;
48674867
- Type: Float
48684868
- Range: `[0, 2147483647]`
48694869
- Default value: `1.5`
4870-
- 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.
4870+
- 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.
48714871
48724872
### tidb_opt_seek_factor
48734873
@@ -4877,7 +4877,7 @@ SHOW WARNINGS;
48774877
- Type: Float
48784878
- Range: `[0, 2147483647]`
48794879
- Default value: `20`
4880-
- 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.
4880+
- 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.
48814881
48824882
### tidb_opt_skew_distinct_agg <span class="version-mark">New in v6.2.0</span>
48834883
@@ -4932,6 +4932,210 @@ SHOW WARNINGS;
49324932
- Default value: `OFF`
49334933
- 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.
49344934
4935+
### tidb_opt_hash_agg_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
4936+
4937+
> **Warning:**
4938+
>
4939+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
4940+
4941+
- Scope: SESSION | GLOBAL
4942+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
4943+
- Type: Float
4944+
- Range: `[0, 2147483647]`
4945+
- Default value: `1`
4946+
4947+
### tidb_opt_hash_join_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
4948+
4949+
> **Warning:**
4950+
>
4951+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
4952+
4953+
- Scope: SESSION | GLOBAL
4954+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
4955+
- Type: Float
4956+
- Range: `[0, 2147483647]`
4957+
- Default value: `1`
4958+
4959+
### tidb_opt_index_join_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
4960+
4961+
> **Warning:**
4962+
>
4963+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
4964+
4965+
- Scope: SESSION | GLOBAL
4966+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
4967+
- Type: Float
4968+
- Range: `[0, 2147483647]`
4969+
- Default value: `1`
4970+
4971+
### tidb_opt_index_lookup_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
4972+
4973+
> **Warning:**
4974+
>
4975+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
4976+
4977+
- Scope: SESSION | GLOBAL
4978+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
4979+
- Type: Float
4980+
- Range: `[0, 2147483647]`
4981+
- Default value: `1`
4982+
4983+
### tidb_opt_index_merge_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
4984+
4985+
> **Warning:**
4986+
>
4987+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
4988+
4989+
- Scope: SESSION | GLOBAL
4990+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
4991+
- Type: Float
4992+
- Range: `[0, 2147483647]`
4993+
- Default value: `1`
4994+
4995+
### tidb_opt_index_reader_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
4996+
4997+
> **Warning:**
4998+
>
4999+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5000+
5001+
- Scope: SESSION | GLOBAL
5002+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5003+
- Type: Float
5004+
- Range: `[0, 2147483647]`
5005+
- Default value: `1`
5006+
5007+
### tidb_opt_index_scan_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5008+
5009+
> **Warning:**
5010+
>
5011+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5012+
5013+
- Scope: SESSION | GLOBAL
5014+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5015+
- Type: Float
5016+
- Range: `[0, 2147483647]`
5017+
- Default value: `1`
5018+
5019+
### tidb_opt_limit_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5020+
5021+
> **Warning:**
5022+
>
5023+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5024+
5025+
- Scope: SESSION | GLOBAL
5026+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5027+
- Type: Float
5028+
- Range: `[0, 2147483647]`
5029+
- Default value: `1`
5030+
5031+
### tidb_opt_merge_join_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5032+
5033+
> **Warning:**
5034+
>
5035+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5036+
5037+
- Scope: SESSION | GLOBAL
5038+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5039+
- Type: Float
5040+
- Range: `[0, 2147483647]`
5041+
- Default value: `1`
5042+
5043+
### tidb_opt_sort_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5044+
5045+
> **Warning:**
5046+
>
5047+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5048+
5049+
- Scope: SESSION | GLOBAL
5050+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5051+
- Type: Float
5052+
- Range: `[0, 2147483647]`
5053+
- Default value: `1`
5054+
5055+
### tidb_opt_stream_agg_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5056+
5057+
> **Warning:**
5058+
>
5059+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5060+
5061+
- Scope: SESSION | GLOBAL
5062+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5063+
- Type: Float
5064+
- Range: `[0, 2147483647]`
5065+
- Default value: `1`
5066+
5067+
### tidb_opt_table_full_scan_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5068+
5069+
> **Warning:**
5070+
>
5071+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5072+
5073+
- Scope: SESSION | GLOBAL
5074+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5075+
- Type: Float
5076+
- Range: `[0, 2147483647]`
5077+
- Default value: `1`
5078+
5079+
### tidb_opt_table_range_scan_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5080+
5081+
> **Warning:**
5082+
>
5083+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5084+
5085+
- Scope: SESSION | GLOBAL
5086+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5087+
- Type: Float
5088+
- Range: `[0, 2147483647]`
5089+
- Default value: `1`
5090+
5091+
### tidb_opt_table_reader_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5092+
5093+
> **Warning:**
5094+
>
5095+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5096+
5097+
- Scope: SESSION | GLOBAL
5098+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5099+
- Type: Float
5100+
- Range: `[0, 2147483647]`
5101+
- Default value: `1`
5102+
5103+
### tidb_opt_table_rowid_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5104+
5105+
> **Warning:**
5106+
>
5107+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5108+
5109+
- Scope: SESSION | GLOBAL
5110+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5111+
- Type: Float
5112+
- Range: `[0, 2147483647]`
5113+
- Default value: `1`
5114+
5115+
### tidb_opt_table_tiflash_scan_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5116+
5117+
> **Warning:**
5118+
>
5119+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5120+
5121+
- Scope: SESSION | GLOBAL
5122+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5123+
- Type: Float
5124+
- Range: `[0, 2147483647]`
5125+
- Default value: `1`
5126+
5127+
### tidb_opt_topn_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>
5128+
5129+
> **Warning:**
5130+
>
5131+
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value.
5132+
5133+
- Scope: SESSION | GLOBAL
5134+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
5135+
- Type: Float
5136+
- Range: `[0, 2147483647]`
5137+
- Default value: `1`
5138+
49355139
### tidb_optimizer_selectivity_level
49365140
49375141
- Scope: SESSION

0 commit comments

Comments
 (0)