MySQL裡創建索引(Create Index)的方法和語法結構及例子
CREATE INDEX Syntax
CREATE [UNIQUE|FULLTEXT|SPATIAL] INDEX index_name
[index_type]
ON tbl_name (index_col_name,...)
[index_type]
www.2cto.com
index_col_name:
col_name [(length)] [ASC | DESC]
index_type:
USING {BTREE | HASH | RTREE}
[java]
-- 創建無索引的表格
create table testNoPK (
id int not null,
name varchar(10)
);
-- 創建普通索引
create index IDX_testNoPK_Name on testNoPK (name);