MySQL里创建索引(Create Index)的方法和语法结构及例子,
CREATE INDEX Syntax
CREATE [UNIQUE|FULLTEXT|SPATIAL] INDEX index_name
[index_type]
ON tbl_name (index_col_name,...)
[index_type]
index_col_name:
col_name [(length)] [ASC | DESC]
index_type:
USING {BTREE | HASH | RTREE}
view plaincopy to clipboardprint?
01.-- 创建无索引的表格
02.create table testNoPK (
03. id int not null,
04. name varchar(10)
05. );
06.-- 创建普通索引
07. create index IDX_testNoPK_Name on testNoPK (name);
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/java2000_net/archive/2009/07/01/4313297.aspx
CREATE INDEX Syntax
CREATE [UNIQUE|FULLTEXT|SPATIAL] INDEX index_name
[index_type]
ON tbl_name (index_col_name,...)
[index_type]
index_col_name:
col_name [(length)] [ASC | DESC]
index_type:
USING {BTREE | HASH | RTREE}
view plaincopy to clipboardprint?
01.-- 创建无索引的表格
02.create table testNoPK (
03. id int not null,
04. name varchar(10)
05. );
06.-- 创建普通索引
07. create index IDX_testNoPK_Name on testNoPK (name);
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/java2000_net/archive/2009/07/01/4313297.aspx