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.
From wikipedia: B-Trees and bitmap indexes. The use cases:
B-Trees are the typical index type used when you do CREATE INDEX ...
in a database:
This characteristics make B-Tree indexes very useful for speeding searches in OLTP applications, when you are working with very small data sets at a time, most queries filter by ID, and you want good concurrent performance.
Bitmap indexes are a more specialized index variant:
Bitmap indexes are mostly used in data warehouse applications, where the database is read only except for the ETL processes, and you usually need to execute complex queries against a star schema, where bitmap indexes can speed up filtering based on conditions in your dimension tables, which do not usually have too many distinct values.
As a very short summary: use B-Tree indexes (the "default" index in most databases) unless you are a data warehouse developer and know you will benefit for a bitmap index.