mysql innodb 主键

  • http://blog.johnjosephbachir.org/2006/10/22/everything-you-need-to-know-about-designing-mysql-innodb-primary-keys/
  • The primary key determines the order in which the data is physically stored in the main data file, aka “the clustered index”. Another way of saying this: the main data file is a B-tree index that directly contains all of a table’s columns, and the key on this B-tree is the primary key. This can result in one less I/O operation (compared to MyISAM) on many queries.
  • The primary key is what is used to associate all of a table’s indexes with the main data file. So the primary key is replicated in every row of every index.
如果不显示的指定主键的话,mysql会默认指定一个隐式的主键,而且是6字节的,
主键应该是有序的
主键应该越小越好,Because the primary key is replicated in every entry of every index, 

你可能感兴趣的:(mysql,Blog)