Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: tidbAUTO_INCREMENT的表还能解决写入特点问题么
【TiDB Usage Environment】Production environment
【TiDB Version】tidb6.1
【Encountered Issue】
【Reproduction Path】What operations were performed to cause the issue
【Problem Phenomenon and Impact】
As mentioned
Write hotspot is very severe
【Attachments】
Please provide the version information of each component, such as cdc/tikv, which can be obtained by executing cdc version/tikv-server --version.
You can change the auto-increment primary key to auto_random. For details, please refer to the official documentation:
Pre-splitting can be achieved, and you can also manually split using the split command, no problem.
Refer to this article:
Using non-clustered tables should also alleviate table hotspot issues.
A better solution is to use auto_random.
Why is it a non-clustered table? Can you explain the principle?
You can study the PCTP course module 7.
Does it mean it can be changed directly?
Try it in a test environment or pre-production environment.
Thank you for the guidance, experts.
Distributed systems were created to replace the sharding and partitioning solutions.
To solve write hotspots, there are two scenarios:
- Clustered table: You cannot use auto_increment, you need to use auto_random (which cannot guarantee increment), and these two cannot be used together.
- Non-clustered table: You can use auto_increment, and use shard_row_id_bits and pre_split_regions to pre-build regions to disperse write hotspots.
This topic was automatically closed 1 minute after the last reply. No new replies are allowed.