B-tree and Bitmap Index
Oracle has 2 kinds of Index: B-tree index and Bitmap Index.
B-tree index is commonly used index, which is created using CREATE INDEX command.
B-tree index structure:
- Root: Pointer to branch node
- Branch: Pointer to Leaf node. The distinct value of index columns are sorted and divided into different groups. Each branch is mapped to a group of data.
- Leaf: Each Leaf contains the rowid of the records it refers to. Leaf node are linked together in both directions, allowing ascending or descending search. Also leaf nodes can be sorted by ascending or descending.
Bitmap index is some special index, which is created using CREATE BITMAP INDEX command.
Bitmap Index structure:
Root: Pointer to branch node Branch: Pointer to Leaf node. Branch contains the start rowid and end rowid of the leaf blocks it refers to. (It is different from B-tree here. Here is start rowid and end rowid.) Leaf: Leaf is a bitmap. Each bit in the bitmap corresponds to a row in the table. You can think the bitmap like a table with RowID as Row Header and Values as column header. When the row has the value of the column header. It is marked to 1, else 0.
The purpose of creating index is to create a map between records and the key value to speed up query. Different Index structure determines different suitable scenario of the 2 kinds of index:
1) When one column has many different distinct values, the bitmap will be very big and constructing the bitmap may cost more resource. So bitmap index is not suitable for colum with many distinct values.
2) For B-tree index, when you update the key column value of a table, instead of update operation on table, Orace deletes the index entry and insert a new entry to the index. For bitmap index, when the key column value is updated, the whole bitmap at leaf level will be recreated. Comparing with B-tree index, it is time-comsuming and resource intensive. So bitmap index is suitable for those static colums with less update.
3) PCTFREE parameters is different for table and index, as storage parameters. PCTFREE for index means the spaces kept for new entries. There is no PCTUSED parameter for Index. For table that is updated incrementally, PCTFREE should be set to a small value to full use disk space and increase query performance. For table that is update frequently, PCTFREE should be set to a high value to keep enough space for update.
4) Logging or large table should be disabled for performance.
5) Index should be put into separated tablespace for parallel process and better performance.
6) Setting higher value for INITRANS on index than corresponding table for better performance, because index can be used by more process than table.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-84734/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【Bitmap Index】B-Tree索引與Bitmap點陣圖索引的鎖代價比較研究Index索引
- Bitmap IndexIndex
- bitmap join indexIndex
- CREATE BITMAP INDEXIndex
- 平衡樹索引(b-tree index)索引Index
- B-Tree Index 成本計算Index
- b+ and bitmap indexIndex
- [轉載]oracle_Bitmap IndexOracleIndex
- Bitmap Index Example (223)Index
- 淺析oracle b-tree index搜尋原理OracleIndex
- oracle 點陣圖索引(bitmap index)Oracle索引Index
- 點陣圖索引:原理(BitMap index)索引Index
- 點陣圖索引(bitmap-index)索引Index
- B-index、bitmap-index、text-index使用場景詳解Index
- Oracle中B-Tree、Bitmap和函式索引使用案例總結Oracle函式索引
- 點陣圖索引(Bitmap Index)——索引共用索引Index
- Bitmap Indexes on Index-Organized Tables (232)IndexZed
- bitmap index點陣圖索引系列(一)Index索引
- PostgreSQL DBA(139) - PG 12(B-tree index improvement 1#)SQLIndex
- What is the difference between Mysql InnoDB B+ tree index and hash index? Why does MongoDB use B-tree?MySqlIndexMongoDB
- PostgreSQL DBA(119) - pgAdmin(LIMIT:Index Scan vs Bitmap Index Scan)SQLMITIndex
- 【索引】Bitmap點陣圖索引與普通的B-Tree索引鎖的比較索引
- B-Tree索引與Bitmap點陣圖索引的鎖代價比較研究索引
- zt_深入理解bitmap index點陣圖索引Index索引
- B-tree Indexes on UROWID Columns for Heap- and Index-Organized Tables (235)IndexZed
- bitmap join index ---資料倉儲優化方法之一Index優化
- Data Warehourse Guide閱讀筆記(五):Bitmap join indexGUIIDE筆記Index
- B-tree
- oracle10g r2_sql tuning_bitmap index點陣圖索引_index效能小測試OracleSQLIndex索引
- 點陣圖索引(Bitmap Index)——從B*樹索引到點陣圖索引索引Index
- 點陣圖索引(Bitmap Index)——點陣圖索引與資料DML鎖定索引Index
- 關於B*tree索引(index)的中度理解及bitmap 索引的一點探究(zt)索引Index
- bitmap
- PostgreSQL的B-tree索引SQL索引
- 十四、Mysql之B-TreeMySql
- BITMAP索引的INLIST ITERATOR與BITMAP OR索引
- c# svg轉Bitmap Bitmap轉ImageSourceC#SVG
- MySQL探索(一):B-Tree索引MySql索引