Can someone explain the different between the bitmap and b tree indexes. in what situations will you use both of these? What are the advantages/disadvantages of each.
When using normal BTree indexes, rows where all the column values are null are excluded from the index. This means that queries with "column is null" conditions won't benefit from a normal index.
By creating an index on (column_name, 1) (or some other constant) null valued columns are now included in it, allowing the optimizer to use the query when executing "is null" queries.
A bitmap index, unlike a B*Tree index, automatically includes null values. This means bitmap indexes may be used by the optimizer in the evaluation of "is null" predicates.
Bitmap indexes may lead to concurrency issues however, possibly blocking other DML on the same table. Therefore these should be avoided in an OLTP applications. Bitmap indexes also require Enterprise Edition, so there may be licensing implications to using these.