Bird
0
0

A query plan includes a Bitmap Index Scan on an index but the query executes slowly. Which of the following is a plausible reason?

medium📝 Debug Q6 of 15
PostgreSQL - Performance Tuning
A query plan includes a Bitmap Index Scan on an index but the query executes slowly. Which of the following is a plausible reason?
AThe table has no indexes at all
BThe index is corrupted and cannot be used
CThe query optimizer always prefers sequential scans over Bitmap Index Scans
DThe Bitmap Index Scan matches a very large number of rows causing many random heap fetches
Step-by-Step Solution
Solution:
  1. Step 1: Analyze Bitmap Index Scan performance

    Bitmap Index Scan is efficient when matching a moderate number of rows.
  2. Step 2: Large matches cause slow heap fetches

    If many rows match, random heap fetches increase, slowing the query.
  3. Final Answer:

    The Bitmap Index Scan matches a very large number of rows causing many random heap fetches -> Option D
  4. Quick Check:

    Corrupted index would cause errors, not slow scans [OK]
Quick Trick: Large matches cause slow Bitmap Index Scans [OK]
Common Mistakes:
  • Assuming index corruption without errors
  • Believing optimizer always prefers sequential scans
  • Ignoring index presence

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes