Skip to content

planner: 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 4 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
153 changes: 153 additions & 0 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -4698,6 +4698,159 @@ 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 v9.0.0</span>

- Scope: SESSION | GLOBAL
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `1`
- This variable is internally used in the Cost Model, and it is NOT recommended to modify its value unless directed by TiDB Optimizer Engineering.

### tidb_opt_hash_join_cost_factor <span class="version-mark">New in v9.0.0</span>

- Scope: SESSION | GLOBAL
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `1`
- This variable is internally used in the Cost Model, and it is NOT recommended to modify its value unless directed by TiDB Optimizer Engineering.

### tidb_opt_index_join_cost_factor <span class="version-mark">New in v9.0.0</span>

- Scope: SESSION | GLOBAL
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `1`
- This variable is internally used in the Cost Model, and it is NOT recommended to modify its value unless directed by TiDB Optimizer Engineering.

### tidb_opt_index_lookup_cost_factor <span class="version-mark">New in v9.0.0</span>

- Scope: SESSION | GLOBAL
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `1`
- This variable is internally used in the Cost Model, and it is NOT recommended to modify its value unless directed by TiDB Optimizer Engineering.

### tidb_opt_index_merge_cost_factor <span class="version-mark">New in v9.0.0</span>

- Scope: SESSION | GLOBAL
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `1`
- This variable is internally used in the Cost Model, and it is NOT recommended to modify its value unless directed by TiDB Optimizer Engineering.

### tidb_opt_index_reader_cost_factor <span class="version-mark">New in v9.0.0</span>

- Scope: SESSION | GLOBAL
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `1`
- This variable is internally used in the Cost Model, and it is NOT recommended to modify its value unless directed by TiDB Optimizer Engineering.

### tidb_opt_index_scan_cost_factor <span class="version-mark">New in v9.0.0</span>

- Scope: SESSION | GLOBAL
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `1`
- This variable is internally used in the Cost Model, and it is NOT recommended to modify its value unless directed by TiDB Optimizer Engineering.

### tidb_opt_limit_cost_factor <span class="version-mark">New in v9.0.0</span>

- Scope: SESSION | GLOBAL
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `1`
- This variable is internally used in the Cost Model, and it is NOT recommended to modify its value unless directed by TiDB Optimizer Engineering.

### tidb_opt_merge_join_cost_factor <span class="version-mark">New in v9.0.0</span>

- Scope: SESSION | GLOBAL
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `1`
- This variable is internally used in the Cost Model, and it is NOT recommended to modify its value unless directed by TiDB Optimizer Engineering.

### tidb_opt_sort_cost_factor <span class="version-mark">New in v9.0.0</span>

- Scope: SESSION | GLOBAL
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `1`
- This variable is internally used in the Cost Model, and it is NOT recommended to modify its value unless directed by TiDB Optimizer Engineering.

### tidb_opt_stream_agg_cost_factor <span class="version-mark">New in v9.0.0</span>

- Scope: SESSION | GLOBAL
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `1`
- This variable is internally used in the Cost Model, and it is NOT recommended to modify its value unless directed by TiDB Optimizer Engineering.

### tidb_opt_table_full_scan_cost_factor <span class="version-mark">New in v9.0.0</span>

- Scope: SESSION | GLOBAL
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `1`
- This variable is internally used in the Cost Model, and it is NOT recommended to modify its value unless directed by TiDB Optimizer Engineering.

### tidb_opt_table_range_scan_cost_factor <span class="version-mark">New in v9.0.0</span>

- Scope: SESSION | GLOBAL
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `1`
- This variable is internally used in the Cost Model, and it is NOT recommended to modify its value unless directed by TiDB Optimizer Engineering.

### tidb_opt_table_reader_cost_factor <span class="version-mark">New in v9.0.0</span>

- Scope: SESSION | GLOBAL
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `1`
- This variable is internally used in the Cost Model, and it is NOT recommended to modify its value unless directed by TiDB Optimizer Engineering.

### tidb_opt_table_rowid_cost_factor <span class="version-mark">New in v9.0.0</span>

- Scope: SESSION | GLOBAL
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `1`
- This variable is internally used in the Cost Model, and it is NOT recommended to modify its value unless directed by TiDB Optimizer Engineering.

### tidb_opt_table_tiflash_scan_cost_factor <span class="version-mark">New in v9.0.0</span>

- Scope: SESSION | GLOBAL
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `1`
- This variable is internally used in the Cost Model, and it is NOT recommended to modify its value unless directed by TiDB Optimizer Engineering.

### tidb_opt_topn_cost_factor <span class="version-mark">New in v9.0.0</span>

- Scope: SESSION | GLOBAL
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Float
- Range: `[0, 2147483647]`
- Default value: `1`
- This variable is internally used in the Cost Model, and it is NOT recommended to modify its value unless directed by TiDB Optimizer Engineering.

### tidb_optimizer_selectivity_level

- Scope: SESSION
Expand Down