I thought of this after reading Meituan’s article: http://tech.meituan.com/MT_Le... but I don’t quite understand
mysql official original words are:
If the primary key is long, the secondary indexes use more space, so it is advantageous to have a short primary key
For example, if uuid is used as the primary key, the primary key space becomes larger. Why does it cause the secondary indexes space to also occupy a large space? I don’t understand
All indexes other than the clustered index are known as secondary indexes. In InnoDB, each record in a secondary index contains the primary key columns for the row, as well as the columns specified for the secondary index. InnoDB uses this primary key value to search for the row in the clustered index.
This is from the official document, which means that the secondary index will also include the primary, so the larger your primary key, the larger the space occupied by the secondary indexes
Reference: https://dev.mysql.com/doc/ref...