SQLMentor // glossary

Bitmap Index

A bitmap index stores a bitmap (a string of 0s and 1s) per distinct value of a column, marking which rows contain that value. It's efficient for low-cardinality columns — like gender or status — where a B-tree index would waste space.

Bitmap indexes shine when combining several low-cardinality filters (WHERE status = 'ACTIVE' AND region = 'EU') because the database can just AND/OR the bitmaps together — extremely fast. They're common in Oracle data warehouses.

The downside: bitmap indexes lock at a coarser grain than B-tree indexes, so they're a poor fit for tables with heavy concurrent single-row inserts and updates (OLTP tables). Reserve them for reporting/warehouse tables with low write concurrency.

CREATE BITMAP INDEX idx_emp_status
  ON employees (status);