MySQL 创建索引(Create Index)的方法和语法结构及例子
CREATE INDEX Syntax文章源自很文博客https://www.hinwi.com/很文博客-https://www.hinwi.com/51793.html
CREATE [UNIQUE|FULLTEXT|SPATIAL] INDEX index_name文章源自很文博客https://www.hinwi.com/很文博客-https://www.hinwi.com/51793.html
[index_type]文章源自很文博客https://www.hinwi.com/很文博客-https://www.hinwi.com/51793.html
ON tbl_name (index_col_name,...)文章源自很文博客https://www.hinwi.com/很文博客-https://www.hinwi.com/51793.html
[index_type]文章源自很文博客https://www.hinwi.com/很文博客-https://www.hinwi.com/51793.html
index_col_name:文章源自很文博客https://www.hinwi.com/很文博客-https://www.hinwi.com/51793.html
col_name [(length)] [ASC | DESC]文章源自很文博客https://www.hinwi.com/很文博客-https://www.hinwi.com/51793.html
index_type:
USING {BTREE | HASH | RTREE}
- -- 创建无索引的表格
- create table testNoPK (
- id int not null,
- name varchar(10)
- );
- -- 创建普通索引
- create index IDX_testNoPK_Name on testNoPK (name);
评论