Skip to content

Bitmap Index

Spicy — senior dev territoryDatabase

ELI5 — The Vibe Check

A bitmap index stores a bit array for each distinct value in a column. If a column has 3 possible values (red, green, blue), there are 3 bitmaps, each with one bit per row. Super efficient for low-cardinality columns like status, gender, or boolean flags. Oracle and PostgreSQL (at query time) use them.

Real Talk

A bitmap index represents each distinct value as a bit vector with one bit per table row. It's extremely space-efficient for low-cardinality columns and excels at combining multiple conditions using bitwise AND/OR operations. PostgreSQL creates bitmap indexes dynamically during query execution (bitmap heap scan) but doesn't support persistent bitmap indexes. Oracle and other databases offer them natively.

When You'll Hear This

"Bitmap indexes shine when combining multiple low-cardinality filters like status AND region AND type." / "PostgreSQL creates bitmap indexes on-the-fly during query execution — you don't need to create them explicitly."

Made with passive-aggressive love by manoga.digital. Powered by Claude.