最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

数据库的几种索引

互联网 admin 5浏览 0评论

数据库的几种索引

(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

数据库的几种索引

(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

与本文相关的文章

发布评论

评论列表 (0)

  1. 暂无评论