oracle之bitmap索引

來源:互聯網
上載者:User

標籤:增刪改查   _id   常見   uil   清除   AC   位元影像索引   space   sele   

oracle常見的索引是BTree索引和Bitmap索引。

BTree索引特點:

  預設索引

  適合大量增刪改查

  不能用or操作符

  適合高基數的列(即唯一值多)

建立sql:create index lie_idx1 on table(liename);

 

Bitmap索引特點:

  做update代價非常高

  非常適合or操作符

  基數少的列(即重複值多)

建立sql:create bitmap index lie_bit_idx1 on table(liename);

Bitmap索引使用配註:

  對列做位元影像索引(Bitmap),該列必須是不常改動的。因為oracle在查詢位元影像索引時,會將尋找的某一重複值都鎖定,在一個sql未提交前,其他使用者操作擁有該重複值的sql會處於阻塞狀態,直至第一個sql被提交。

 

建立索引的一些規則:

1、權衡索引和DML之間的關係。執行DML語句會修改索引

2、把索引和表資料放在不同的資料表空間。讀取表資料時可以並行讀取索引【移動索引:alter index indexname rebuild tablespace】

 

索引的常用操作:

重新建立索引:alter index indexname rebuild tablespace indexname2;  資料庫操作刪除命令後,索引記錄並不會馬上清除

線上重建索引:alter index indexname rebuild online;

整合索引:alter index indexname coalesce;  用於整理索引片段

刪除索引:drop index scott.indexname;

分析索引:

  1、查詢存放分析資料的表:select count(*) from index_status;

  2、執行分析索引命令:analyze index indexname validate structrue;   --分析完該索引資訊會存於index_status表中。

 

oracle之bitmap索引

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.