Skip to content

system-variables: add optimizer cost factors #20748

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 204 additions & 0 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -4698,6 +4698,210 @@
- 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 internally used in 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_hash_join_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>

> **Warning:**
>
> This variable is internally used in 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 internally used in 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 internally used in 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 internally used in 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 internally used in 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 internally used in 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 internally used in 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 internally used in 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 internally used in 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 internally used in 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 internally used in 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 internally used in 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 internally used in 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 internally used in 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 internally used in 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`

Check warning on line 4892 in system-variables.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [PingCAP.Ambiguous] Consider using a clearer word than 'many' because it may cause confusion. Raw Output: {"message": "[PingCAP.Ambiguous] Consider using a clearer word than 'many' because it may cause confusion.", "location": {"path": "system-variables.md", "range": {"start": {"line": 4892, "column": 350}}}, "severity": "INFO"}
### tidb_opt_topn_cost_factor <span class="version-mark">New in v8.5.3 and v9.0.0</span>

> **Warning:**
>
> This variable is internally used in 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
Expand Down