Middle
What is a bitmap index and when is it used?
sobes.tech AI
Answer from AI
Bitmap index — is a type of index in databases that uses bit vectors (bitmaps) to represent the presence or absence of values in table rows.
Each unique value of a column corresponds to a bit vector, where each bit indicates whether that value exists in the corresponding row.
Advantages of bitmap indexes:
- Very efficient for columns with low cardinality (e.g., gender, status).
- Fast processing of complex queries with AND, OR, NOT conditions through bitwise operations.
Example of usage: In a table with a "gender" field (male/female), a bitmap index is created. For a query "gender = male," the database quickly selects rows where the corresponding bit is set.
In machine learning and big data processing, bitmap indexes help optimize filtering and aggregation of data, speeding up sample preparation and calculations on large volumes.