Home  >  Article  >  Database  >  mysql-Mysql中index与key的区别

mysql-Mysql中index与key的区别

WBOY
WBOYOriginal
2016-06-06 09:44:171205browse

mysqlindexkey

-------------------------+
| user | CREATE TABLE user (
id int(11) NOT NULL,
name varchar(50) default NULL,
companyId int(11) default NULL,
PRIMARY KEY (id),
KEY company_user_id (companyId)
) ENGINE=InnoDB DEFAULT CHARSET=gbk |

上面的建表语句中,KEY company_user_id (companyId),这句话起什么作用?
和 index company_user_id (companyId)有什么区别?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn