Recall & Review
beginner
What is a Bitmap Index Scan in PostgreSQL?
A Bitmap Index Scan is a method PostgreSQL uses to quickly find rows matching a condition by creating a bitmap of matching row locations, which it then uses to fetch the actual rows efficiently.
Click to reveal answer
intermediate
How does PostgreSQL use a bitmap during a Bitmap Index Scan?
PostgreSQL builds a bitmap where each bit represents a row in the table. Bits set to 1 indicate rows that match the index condition. This bitmap helps combine multiple index scans and reduces random disk access.
Click to reveal answer
intermediate
Why is Bitmap Index Scan more efficient than a normal Index Scan for multiple conditions?
Because it can combine multiple bitmaps from different indexes using bitwise operations, reducing the number of rows to fetch and minimizing random disk reads.
Click to reveal answer
beginner
What happens after PostgreSQL creates the bitmap in a Bitmap Index Scan?
PostgreSQL performs a Bitmap Heap Scan, which uses the bitmap to fetch the actual rows from the table in an efficient order, reducing disk seeks.
Click to reveal answer
intermediate
When might PostgreSQL choose a Bitmap Index Scan over a Sequential Scan?
When the query filters on indexed columns and the number of matching rows is moderate, so using the bitmap reduces the cost of fetching rows compared to scanning the whole table.
Click to reveal answer
What does a Bitmap Index Scan create to represent matching rows?
✗ Incorrect
A Bitmap Index Scan creates a bitmap where each bit corresponds to a row, set to 1 if the row matches the condition.
Which step follows after building the bitmap in a Bitmap Index Scan?
✗ Incorrect
After building the bitmap, PostgreSQL performs a Bitmap Heap Scan to fetch the actual rows efficiently.
Why is Bitmap Index Scan useful for queries with multiple conditions on different indexes?
✗ Incorrect
Bitmap Index Scan can combine multiple bitmaps from different indexes using bitwise AND/OR to find matching rows efficiently.
When is Bitmap Index Scan less efficient than a Sequential Scan?
✗ Incorrect
If most rows match, scanning the whole table sequentially is often faster than building and using a bitmap.
What does each bit in the bitmap represent in a Bitmap Index Scan?
✗ Incorrect
Each bit corresponds to a specific row in the table, indicating if it matches the index condition.
Explain how PostgreSQL uses a Bitmap Index Scan to improve query performance.
Think about how bits represent rows and how combining them helps.
You got /4 concepts.
Describe when PostgreSQL might choose a Bitmap Index Scan instead of a Sequential Scan or a normal Index Scan.
Consider query filtering and index availability.
You got /4 concepts.