);
3、在存在的数据库表中创建索引
3.1、创建普通索引
create index 索引名 on 数据表名称(字段名称); 3.2、创建唯一索引
create unique index 索引名 on 数据表名称(字段名称); 3.3、创建全文索引
create fulltext index 索引名 on 数据表名称(字段名称); 3.4、创建单列索引
create index 索引名 on 数据表名称(字段名称(长度)) 3.5、创建单列索引
create index 索引名 on 数据表名称(字段名称1,字段名称2,...); 3.6、创建空间索引
create spatial index 索引名 on 数据表名称(字段名称); 4、添加索引
4.1、添加普通索引
alter table 表名 add index 索引名称(字段名称); 4.2、添加唯一索引
alter table 表名 add unique index 索引名称(字段名称); 4.3、添加全文索引
alter table 表名 add fulltext index 索引名称(字段名称); 4.4、添加单列索引
alter table 表名 add index 索引名称(字段名称(长度)); 4.5、添加多列索引
alter table 表名 add index 索引名称(字段名称,字段名称2...); 4.6、添加空间索引
alter table 表名 add spatial index 索引名称(字段名称); 5、删除索引
drop index 索引名 on 数据库表名; 三、结束语:
到这儿,我们的索引就差不多学完了,这些要而是一些比较重要的索引的概念。需要大家掌握好而运用好。谢谢!