Bird
0
0

After running EXPLAIN ANALYZE, you notice the output shows Buffers: shared hit=100 but your query is slower than expected. What might be the issue?

medium📝 Debug Q7 of 15
PostgreSQL - Set Operations and Advanced Queries
After running EXPLAIN ANALYZE, you notice the output shows Buffers: shared hit=100 but your query is slower than expected. What might be the issue?
AThe EXPLAIN ANALYZE command was run incorrectly
BThe query plan is missing an index scan
CThe query did not run because buffers hit means error
DThe data was read from cache, so disk I/O is not the bottleneck
Step-by-Step Solution
Solution:
  1. Step 1: Understand buffer hits

    Buffers shared hit means data was read from memory cache, not disk.
  2. Step 2: Analyze performance implication

    If data is cached, slow query is likely due to CPU or inefficient plan, not disk I/O.
  3. Final Answer:

    The data was read from cache, so disk I/O is not the bottleneck -> Option D
  4. Quick Check:

    Buffers hit = data cached, disk not bottleneck [OK]
Quick Trick: Buffers hit means data read from cache, not disk [OK]
Common Mistakes:
  • Assuming buffers hit means query error
  • Thinking disk I/O caused slowness despite cache
  • Believing EXPLAIN ANALYZE was run incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes