我是看了美团的文章 : http://tech.meituan.com/MT_Le... 想到的, 不太明白
mysql官方原话是:
If the primary key is long, the secondary indexes use more space, so it is advantageous to have a short primary key
比如 uuid 当主键, 主键空间就变大了, 为啥会导致secondary indexes空间占用也大呢, 搞不明白
習慣沉默2017-05-18 10:55:33
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.
这个是官方文档中的,意思是secondary index也会包含primary,所以你主键越大,secondary indexes空间占用也越大
参考:https://dev.mysql.com/doc/ref...