Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: TiDB和设计Schema主键的时候,生产中一般怎么实践

How is TiDB and schema primary key design generally practiced in production?
Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: TiDB和设计Schema主键的时候,生产中一般怎么实践
How is TiDB and schema primary key design generally practiced in production?
The primary key can use AUTO_INCREMENT (auto-increment AUTO_ID_CACHE 1 can ensure unique auto-increment, not equal to 1 does not guarantee unique auto-increment), AUTO_RANDOM (random) or UUID, or custom primary keys, such as single-column unique non-null fields, or multi-column composite fields, etc. Each table can choose the most suitable one according to the specific business situation.
For the bigint type, autorandom, it’s best to split according to the number of TiKV nodes.
Generally, it is based on the business, setting the most commonly used meaningful primary key.
For the bigint type, autorandom, it’s best to split according to the number of TiKV nodes.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.