CS FundamentalsHardWipro · Cognizant pattern

Which of these is the best reason a database might choose to use a bitmap index rather than a B+ tree index on a column?

  1. A. Bitmap indexes are always faster for single-row updates in a high-concurrency OLTP system
  2. B. Bitmap indexes eliminate the need for any WHERE clause optimization
  3. C. The column has very high cardinality (e.g. almost every value is unique, like an email address)
  4. D. The column has LOW cardinality (few distinct values, e.g. gender or a status flag with 3-4 possible values), where a bitmap per distinct value, combined with fast bitwise AND/OR across columns, is compact and efficient for complex multi-column filtering

Correct answer: D. The column has LOW cardinality (few distinct values, e.g. gender or a status flag with 3-4 possible values), where a bitmap per distinct value, combined with fast bitwise AND/OR across columns, is compact and efficient for complex multi-column filtering

Bitmap indexes store one bit vector per distinct value, marking which rows have it — this is compact and extremely fast to combine with AND/OR across several low-cardinality columns (common in data-warehouse/OLAP-style filtering), but updating a single row requires touching (and often locking) a whole bitmap, making bitmap indexes a poor fit for high-cardinality columns or heavy single-row OLTP updates.

More DBMS and SQL questions

Exams that ask this topic