Bird
0
0

To improve performance of a query using Bitmap Index Scan that suffers from slow heap access due to many random fetches, which strategy is most effective?

hard📝 Application Q8 of 15
PostgreSQL - Performance Tuning
To improve performance of a query using Bitmap Index Scan that suffers from slow heap access due to many random fetches, which strategy is most effective?
ACreate a covering index to enable an Index Only Scan and reduce heap access
BIncrease the work_mem setting to allow larger bitmaps
CDisable Bitmap Index Scans in the planner
DRewrite the query to use a sequential scan
Step-by-Step Solution
Solution:
  1. Step 1: Identify cause of slow heap access

    Many random heap fetches slow down Bitmap Index Scan queries.
  2. Step 2: Use covering index

    A covering index contains all needed columns, enabling Index Only Scan which avoids heap fetches.
  3. Final Answer:

    Create a covering index to enable an Index Only Scan and reduce heap access -> Option A
  4. Quick Check:

    Covering indexes reduce heap fetches [OK]
Quick Trick: Covering index enables Index Only Scan [OK]
Common Mistakes:
  • Thinking increasing work_mem fixes heap fetch slowness
  • Disabling Bitmap Index Scans reduces performance
  • Switching to sequential scan ignores index benefits

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes