数据库的几种索引

来源:互联网 发布:手机怎么注册开淘宝店 编辑:程序博客网 时间:2024/06/09 18:16

(1)按照索引列值的唯一性,索引可分为唯一索引和非唯一索引
①非唯一索引:B树索引
create index 索引名 on 表名(列名) tablespace 表空间名;
②唯一索引:建立主键或者唯一约束时会自动在对应的列上建立唯一索引
(2)索引列的个数:单列索引和复合索引
(3)按照索引列的物理组织方式
①B树索引
create index 索引名 on 表名(列名) tablespace 表空间名;
②位图索引
create bitmap index 索引名 on 表名(列名) tablespace 表空间名;
③反向键索引
create index 索引名 on 表名(列名) reverse tablespace 表空间名;
④函数索引
create index 索引名 on 表名(函数名(列名)) tablespace 表空间名;

删除索引
drop index 索引名
重建索引
alter index 索引名 rebuild

原创粉丝点击