Wednesday, June 27, 2007

The Secrets of Oracle Bitmap Indexes

The Secrets of Oracle Bitmap Indexes

"Characteristic of Bitmap Indexes

  • For columns with very few unique values (low cardinality)

Columns that have low cardinality are good candidates (if the cardinality of a column is <= 0.1 % that the column is ideal candidate, consider also 0.2% – 1%)

  • Tables that have no or little insert/update are good candidates (static data in warehouse)
  • Stream of bits: each bit relates to a column value in a single row of table

create bitmap index person_region on person (region);

Row Region North East West South
1 North 1 0 0 0
2 East 0 1 0 0
3 West 0 0 1 0
4 West 0 0 1 0
5 South 0 0 0 1
6 North 1 0 0 0

Advantage of Bitmap Indexes

The advantages of them are that they have a highly compressed structure, making them fast to read and their structure makes it possible for the system to combine multiple indexes together for fast access to the underlying table."