In Clustered Indexes | PingCAP Docs
The table data takes up more storage space if the data type of the primary key is larger than 64 bits, especially when there are multiple secondary indexes.
Hi, why just that 64bits of PK will consume more space? I meant 64 bits is really small – even a UUID is 128 bits
The statement in the documentation is referring to the storage space overhead caused by a larger primary key data type, especially when there are multiple secondary indexes. It does not mean that a 64-bit primary key is considered large in general.
When the primary key data type is larger than 64 bits, such as UUID (128 bits), it can result in increased storage space usage because the primary key values are stored in the secondary indexes as well. This means that each secondary index entry will also include the primary key value, leading to additional storage overhead.
In the case of a 64-bit primary key, the storage space overhead may not be as significant compared to larger data types like UUID. However, it is still worth considering the potential impact on storage space when using a larger primary key data type, especially when there are multiple secondary indexes .
Please note that this statement is specific to the context of TiDB and its clustered indexes. The impact on storage space may vary depending on the database system and its indexing mechanisms.
Let me know if you have any further questions!
: TiDB Documentation - Clustered Indexes