oracle 索引(Bitmap Index)
来源:互联网 发布:oracle sql declare 编辑:程序博客网 时间:2024/05/01 17:36
一 Bitmap index
Bitmap index 的特点:
1. 对于大数据量的查询,bitmap index 能更有效的减少响应时间
2. 减少index的占用空间
当查询语句的where 字句中包含多个column时, 位图索引最为有效. 因为在查询表之前, 那些有一个不符合所有column条件的row会直接被bitmap index 过滤掉.这样就大大减少了响应时间. 在多数情况下, 一般最好是针对单个column建立bitmap index 而不是组合索引.
创建bitmap index的时候, 必须使用 nologging 和 compute statistics.而且, bitmap index 如果有问题, 最好是直接drop 然后重建而不是去想办法维护它.
Cardinality 基数, 势的集
每个column不同的值的个数叫基数. distinct value. bitmap index 非常适合建在基数比较小的column上, 比如说性别.而且如果说某个table里面有1000000条记录, 而某个column只有1000个不同的值, 相当于记录条数是0.1%. 这种情况下, 使用bitmap index也是不错的.
对于具有唯一约束的或者是基数比较大的column, 比如ID, 最好用普通索引, 即b-tree index.
对于fact table 和 dimension table, 可以在fact table中的外键上建立bitmap index.
bitmap index 和 b-tree 另外一个最大的不同在于对NULL 的处理. bitmap index 可以处理null值, 而b-tree index 则无法存储NULL. 如果是bitmap index 的话, 你可以在where 字句中使用NULL, 如:
select count(*) from customer where customer_long_name is null;
此时, oracle 会使用customer_long_name 上的bitmap_index快速得到值, 甚至不用去真正的access table 上的数据.
但是b-tree无法做到这点因为你无法在b-tree 上存储NULL值. 所以当你执行:
select count(*) from customer 的时候, oracle 会自动从NOT NULL的字段上计算总数.
在partitioned table 上, Bitmap index 只能是local index 而不能是global index.
- oracle 索引(Bitmap Index)
- Oracle编程艺术学习笔记-位图索引(bitmap index)
- 位图索引(Bitmap Index)
- 位图索引(bitmap index)
- 位图索引(Bitmap Index)
- Oracle - index (索引)
- 位图索引:原理(BitMap index)
- 位图索引 Bitmap index
- 《Oracle编程艺术》学习笔记(32)-位图索引(bitmap index)
- Oracle编程高手箴言:位图索引(Bitmap Index)的故事
- Oracle编程高手箴言:位图索引(Bitmap Index)的故事
- Oracle编程高手箴言:位图索引(Bitmap Index)的故事
- Oracle编程高手箴言:位图索引(Bitmap Index)的故事
- 《Oracle SQL优化基础》之位图索引(BitMap index)
- 位图索引(Bitmap Index)——索引共用
- oracle bitmap index
- ORACLE BITMAP INDEX
- oracle bitmap join index
- VS2010 C++环境下DLL和LIB文件目录及名称修改
- Unity3d NGUI的使用(二)(UILabel中文字体及可点击的字体)
- 浅谈jsp、freemarker、velocity区别
- 常见的笔试题--C/C++(持续更新)
- AWS云平台的服务概览(下):部署和管理服务
- oracle 索引(Bitmap Index)
- MyEclipse中web项目修改部署路径
- Delphi中destroy, free, freeAndNil, release用法和区别
- 浅谈怎样通过网站优化来提高网站的排名
- java实例摘要
- 歌是我最好的陪伴
- Java中Date各种相关用法
- MIME 对应类型文件参照表(下载或者发送邮件时候可能用得到)
- UIImage:使用RGB颜色值来生成图片