主键是否在MySQL中自动索引?

问题描述:

您需要显式创建索引,还是在定义主键时是隐式的?答案是相同的MyISAM和InnoDB?

Do you need to explicitly create an index, or is it implicit when defining the primary key? Is the answer the same for MyISAM and InnoDB?

主键索引始终。这是为MyISAM和InnoDB相同的,并且通常是为所有的存储引擎,在所有支持指数真

The primary key is always indexed. This is the same for MyISAM and InnoDB, and is generally true for all storage engines that at all supports indices.