MySQL create table语法中的key与index的区别

  在create table的语句中,key和index混淆在一起,官方手册中的解释是这样:

  KEY is normally a synonym for INDEX. The key attribute PRIMARY KEY can also be specified as just KEY when given in a column definition. This was implemented for compatibility with other database systems.

  KEY通常是INDEX的同义词。当在列定义中给出时,键属性PRIMARY KEY也可以被指定为KEY。这是为了与其他数据库系统兼容而实现的。

posted @ 2019-05-24 11:27  爆炸的果核  阅读(3272)  评论(0编辑  收藏  举报