-
Notifications
You must be signed in to change notification settings - Fork 705
system-variables: add optimizer cost factors (#20748) #21602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9fc5a02
8c92cdf
656a366
f9d59f7
3d5a26f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4114,7 +4114,7 @@ As shown in this diagram, when [`tidb_enable_paging`](#tidb_enable_paging-new-in | |
- Type: Float | ||
- Range: `[0, 18446744073709551615]` | ||
- 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. | ||
- 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. | ||
|
||
### tidb_opt_copcpu_factor | ||
|
||
|
@@ -4124,7 +4124,7 @@ As shown in this diagram, when [`tidb_enable_paging`](#tidb_enable_paging-new-in | |
- Type: Float | ||
- Range: `[0, 18446744073709551615]` | ||
- 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. | ||
- 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. | ||
|
||
### tidb_opt_correlation_exp_factor | ||
|
||
|
@@ -4158,7 +4158,7 @@ As shown in this diagram, when [`tidb_enable_paging`](#tidb_enable_paging-new-in | |
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- 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. | ||
- 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. | ||
|
||
### `tidb_opt_derive_topn` <span class="version-mark">New in v7.0.0</span> | ||
|
||
|
@@ -4177,7 +4177,7 @@ As shown in this diagram, when [`tidb_enable_paging`](#tidb_enable_paging-new-in | |
- Type: Float | ||
- Range: `[0, 18446744073709551615]` | ||
- 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. | ||
- 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. | ||
|
||
### tidb_opt_disk_factor | ||
|
||
|
@@ -4187,7 +4187,7 @@ As shown in this diagram, when [`tidb_enable_paging`](#tidb_enable_paging-new-in | |
- Type: Float | ||
- Range: `[0, 18446744073709551615]` | ||
- 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. | ||
- 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. | ||
|
||
### tidb_opt_distinct_agg_push_down | ||
|
||
|
@@ -4392,7 +4392,7 @@ mysql> desc select count(distinct a) from test.t; | |
- 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. | ||
- 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. | ||
|
||
### tidb_opt_mpp_outer_join_fixed_build_side <span class="version-mark">New in v5.1.0</span> | ||
|
||
|
@@ -4411,7 +4411,7 @@ mysql> desc select count(distinct a) from test.t; | |
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- 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. | ||
- 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. | ||
|
||
### tidb_opt_objective <span class="version-mark">New in v7.4.0</span> | ||
|
||
|
@@ -4825,7 +4825,7 @@ SHOW WARNINGS; | |
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- 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. | ||
- 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. | ||
|
||
### tidb_opt_seek_factor | ||
|
||
|
@@ -4835,7 +4835,7 @@ SHOW WARNINGS; | |
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- 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. | ||
- 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. | ||
|
||
### tidb_opt_skew_distinct_agg <span class="version-mark">New in v6.2.0</span> | ||
|
||
|
@@ -4890,6 +4890,210 @@ SHOW WARNINGS; | |
- Default value: `OFF` | ||
- 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. | ||
|
||
### tidb_opt_hash_agg_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span> | ||
|
||
> **Warning:** | ||
> | ||
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To improve clarity and completeness, please add a brief description of what this variable controls. This comment applies to all the new For example, for - This variable is used to adjust the cost of the HashAgg operator. Style Guide ReferencesFootnotes |
||
|
||
### tidb_opt_hash_join_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span> | ||
|
||
> **Warning:** | ||
> | ||
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1` | ||
|
||
### tidb_opt_index_join_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span> | ||
|
||
> **Warning:** | ||
> | ||
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1` | ||
|
||
### tidb_opt_index_lookup_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span> | ||
|
||
> **Warning:** | ||
> | ||
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1` | ||
|
||
### tidb_opt_index_merge_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span> | ||
|
||
> **Warning:** | ||
> | ||
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1` | ||
|
||
### tidb_opt_index_reader_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span> | ||
|
||
> **Warning:** | ||
> | ||
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1` | ||
|
||
### tidb_opt_index_scan_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span> | ||
|
||
> **Warning:** | ||
> | ||
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1` | ||
|
||
### tidb_opt_limit_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span> | ||
|
||
> **Warning:** | ||
> | ||
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1` | ||
|
||
### tidb_opt_merge_join_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span> | ||
|
||
> **Warning:** | ||
> | ||
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1` | ||
|
||
### tidb_opt_sort_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span> | ||
|
||
> **Warning:** | ||
> | ||
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1` | ||
|
||
### tidb_opt_stream_agg_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span> | ||
|
||
> **Warning:** | ||
> | ||
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1` | ||
|
||
### tidb_opt_table_full_scan_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span> | ||
|
||
> **Warning:** | ||
> | ||
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1` | ||
|
||
### tidb_opt_table_range_scan_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span> | ||
|
||
> **Warning:** | ||
> | ||
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1` | ||
|
||
### tidb_opt_table_reader_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span> | ||
|
||
> **Warning:** | ||
> | ||
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1` | ||
|
||
### tidb_opt_table_rowid_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span> | ||
|
||
> **Warning:** | ||
> | ||
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1` | ||
|
||
### tidb_opt_table_tiflash_scan_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span> | ||
|
||
> **Warning:** | ||
> | ||
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1` | ||
|
||
### tidb_opt_topn_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span> | ||
|
||
> **Warning:** | ||
> | ||
> This variable is used internally by the [cost model](/cost-model.md), and it is **NOT** recommended to modify its value. | ||
|
||
- Scope: SESSION | GLOBAL | ||
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes | ||
- Type: Float | ||
- Range: `[0, 2147483647]` | ||
- Default value: `1` | ||
|
||
### tidb_optimizer_selectivity_level | ||
|
||
- Scope: SESSION | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with other variable headings in this document and to adhere to the style guide, please wrap the system variable name in backticks.1
This suggestion applies to all new
tidb_opt_*_cost_factor
variables added in this pull request.Style Guide References
Footnotes
The style guide specifies that code snippets, command names, options, and paths should be enclosed in backticks. (link) ↩