-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
sys-var: change tidb_scatter_region
usage definition
#18626
Open
Benjamin2037
wants to merge
11
commits into
pingcap:master
Choose a base branch
from
Benjamin2037:tidb_scatter_region_changes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
1b1518f
Update tidb_scatter_region usage for new definition.
Benjamin2037 49de5b9
Add sesssion level support.
Benjamin2037 cf18201
Update system-variables.md
Benjamin2037 cb2acbb
Update system-variables.md
hfxsd e232eb8
Update system-variables.md
hfxsd 2aa89b4
Update system-variables.md
hfxsd 0535db1
Update system-variables.md
hfxsd 3ee904a
Update system-variables.md
Benjamin2037 d13ea86
Update system-variables.md
hfxsd d21c82f
minus edit.
Benjamin2037 0bd94ce
Update wording and format
lilin90 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4149,12 +4149,16 @@ EXPLAIN FORMAT='brief' SELECT COUNT(1) FROM t WHERE a = 1 AND b IS NOT NULL; | |
|
||
### `tidb_scatter_region` | ||
|
||
- 作用域:GLOBAL | ||
- 作用域:SESSION | GLOBAL | ||
- 是否持久化到集群:是 | ||
- 是否受 Hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value) 控制:否 | ||
- 类型:布尔型 | ||
- 默认值:`OFF` | ||
- TiDB 默认会在建表时为新表分裂 Region。开启该变量后,会在建表语句执行时,同步打散刚分裂出的 Region。适用于批量建表后紧接着批量写入数据,能让刚分裂出的 Region 先在 TiKV 分散而不用等待 PD 进行调度。为了保证后续批量写入数据的稳定性,建表语句会等待打散 Region 完成后再返回建表成功,建表语句执行时间会是该变量关闭时的数倍。 | ||
- 类型:枚举型 | ||
- 默认值:`` | ||
- 可选值:``,`TABLE`,`GLOBAL` | ||
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. @hfxsd 后续需要关注下 PR 合并后官方文档的效果,第一个空的可选值导致 GitHub 页面解析有问题: |
||
- TiDB 默认会在建表时为新表分裂 Region,使用该变量控制表分裂打散策略,TiDB 会根据选择的打散策略进行 Region 打散。适用于批量建表后紧接着批量写入数据,能让刚分裂出的 Region 先在 TiKV 分散而不用等待 PD 进行调度。为了保证后续批量写入数据的稳定性,建表语句会等待打散 Region 完成后再返回建表成功,建表语句执行时间会是该变量关闭时的数倍。可选值包括: | ||
- 默认值为 ``,表示对于表 Region 不进行打散。 | ||
lilin90 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- `TABLE` 表示 TiDB 会按照表数据分布情况对于表数据进行打散。 | ||
- `GLOBAL` 表示 TiDB 会按照集群整体的数据分布情况对于数据进行打散。在建表语句执行时,同步打散刚分裂出的 Region。 | ||
hfxsd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- 如果建表时设置了 `SHARD_ROW_ID_BITS` 和 `PRE_SPLIT_REGIONS`,建表成功后会均匀切分出指定数量的 Region。 | ||
|
||
### `tidb_schema_version_cache_limit` <span class="version-mark">从 v7.4.0 版本开始引入</span> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
should we keep the original global level?
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.
Yes,Current implement should add session level sys var change and also keep global level implementation.