Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: tidb 非int 类型的字段是否可以当聚簇索引表的主键
In the DEV COURSE 3: Unique Features and Transaction Control of TiDB, it is mentioned that if the primary key is not of the int data type, TiDB will create a non-clustered index for the table. However, based on my tests, when creating a table with create table t1(id varchar(10) primary key, a varchar(10));
and setting the primary key field as varchar, checking with show create table t1
shows that it is a clustered index table. I am not sure if the course content is incorrect?