Skip to content
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

sysvars: add tidb_shard_row_id_bits and tidb_pre_split_regions #18917

Merged
merged 4 commits into from
Oct 15, 2024
Merged
Changes from 3 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
20 changes: 20 additions & 0 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -3159,6 +3159,16 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified
- Range: `[1, 100000]`
- This variable controls the maximum number of execution plans that can be cached by [Non-prepared plan cache](/sql-non-prepared-plan-cache.md).

### tidb_pre_split_regions <span class="version-mark">New in v8.4.0</span>

- Scope: SESSION | GLOBAL
- Persists to cluster: Yes
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No
- Type: Integer
- Default value: `0`
- Range: `[0, 15]`
- This variable is used to set the default row split shards number for newly created tables. When this variable is set to a non-zero value, TiDB will automatically set it when executing `CREATE TABLE` statements, allowing use of `PRE_SPLIT_REGIONS` on such tables (for example NONCLUSTERED tables). For more information, see [`PRE_SPLIT_REGIONS`](/sql-statements/sql-statement-split-region.md#pre_split_regions). This variable is typically used in conjunction with [`tidb_shard_row_id_bits`](/system-variables.md#tidb_shard_row_id_bits-new-in-v840) to shard new tables and split the Regions of new tables.
lilin90 marked this conversation as resolved.
Show resolved Hide resolved

### tidb_generate_binary_plan <span class="version-mark">New in v6.2.0</span>

> **Note:**
Expand Down Expand Up @@ -5271,6 +5281,16 @@ SHOW WARNINGS;
- Range: `[1, 9223372036854775807]`
- This variable controls the maximum number of continuous IDs to be allocated for the [`AUTO_RANDOM`](/auto-random.md) or [`SHARD_ROW_ID_BITS`](/shard-row-id-bits.md) attribute. Generally, `AUTO_RANDOM` IDs or the `SHARD_ROW_ID_BITS` annotated row IDs are incremental and continuous in one transaction. You can use this variable to solve the hotspot issue in large transaction scenarios.

### tidb_shard_row_id_bits <span class="version-mark">New in v8.4.0</span>

- Scope: SESSION | GLOBAL
- Persists to cluster: Yes
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No
- Type: Integer
- Default value: `0`
- Range: `[0, 15]`
- This variable is used to set the shard bits for the default row ID of a new table. When this variable has a non-zero value, TiDB will automatically set this property when executing `CREATE TABLE` statements on tables that allow using `SHARD_ROW_ID_BITS` (such as NONCLUSTERED tables). For more information, see [`SHARD_ROW_ID_BITS`](/shard-row-id-bits.md).
lilin90 marked this conversation as resolved.
Show resolved Hide resolved

### tidb_simplified_metrics

> **Note:**
Expand Down
Loading