Can tables with tidbAUTO_INCREMENT still solve write characteristic issues?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tidbAUTO_INCREMENT的表还能解决写入特点问题么

| username: tidb狂热爱好者

【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.

| username: Raymond | Original post link

You can change the auto-increment primary key to auto_random. For details, please refer to the official documentation:

| username: xfworld | Original post link

Pre-splitting can be achieved, and you can also manually split using the split command, no problem.

Refer to this article:

| username: cs58_dba | Original post link

Using non-clustered tables should also alleviate table hotspot issues.

| username: ablewang_xiaobo | Original post link

A better solution is to use auto_random.

| username: tidb狂热爱好者 | Original post link

Why is it a non-clustered table? Can you explain the principle?

| username: cs58_dba | Original post link

You can study the PCTP course module 7.

| username: tidb狂热爱好者 | Original post link

Does it mean it can be changed directly?

| username: cs58_dba | Original post link

Try it in a test environment or pre-production environment.

| username: tidb狂热爱好者 | Original post link

Thank you for the guidance, experts.

| username: cs58_dba | Original post link

Distributed systems were created to replace the sharding and partitioning solutions.

| username: tidb狂热爱好者 | Original post link

This can be resolved.

| username: 特雷西-迈克-格雷迪 | Original post link

To solve write hotspots, there are two scenarios:

  1. Clustered table: You cannot use auto_increment, you need to use auto_random (which cannot guarantee increment), and these two cannot be used together.
  2. 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.
| username: tidb狂热爱好者 | Original post link

  1. Clustered table: Cannot use auto_increment, must use auto_random (which cannot guarantee increment), these two cannot be used together.
  2. Non-clustered table: Can use auto_increment, use shard_row_id_bits and pre_split_regions to pre-build regions to disperse write hotspots.
    This is correct.
| username: system | Original post link

This topic was automatically closed 1 minute after the last reply. No new replies are allowed.