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

Using shard index to scatter integer hot index #31040

Closed
TonsnakeLin opened this issue Dec 27, 2021 · 0 comments · Fixed by #30659 or #31260
Closed

Using shard index to scatter integer hot index #31040

TonsnakeLin opened this issue Dec 27, 2021 · 0 comments · Fixed by #30659 or #31260
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@TonsnakeLin
Copy link
Contributor

TonsnakeLin commented Dec 27, 2021

## Enhancement
Hot index reduces the write scalability of the TiDB cluster when the written data is monotonically increasing. Using an expression index to scatter the hot index, the new expression index is called a shard index. The expression prefix of shard index must be tidb_shard() that is a new TiDB built-in function.

In order to simplify the work, Only scatter integer unique index. e.g. there is a index "unique key(id)" and it is a hot index. Using the new index "unique key(tidb_shard(id), id)" to replace it.

There are scalability of hot index and shard index.
scalability of hot index
image

scalability of shard index
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
1 participant