Tutorials Courses Interview Prep (100 Q&A) AI Tools (50) Developer Tools (50) Tracks Pricing Plans Blog & Articles Contact Us
PostgreSQL Enterprise & Performance 5-8 Years (Senior) Hard Production Scenario

How does `EXPLAIN (ANALYZE, BUFFERS)` reveal Shared Hit vs Shared Read disk IO bottlenecks?

Real-World Scenario / Incident Description

Determining whether a slow query is CPU-bound or waiting for disk pages to be loaded into PostgreSQL shared buffers.

513 views • Updated 1 month ago

Analyzing BUFFERS Metrics

EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM accounts WHERE balance > 50000;
  • shared hit=5000: 5,000 data blocks were read directly from RAM (Shared Buffers cache) with zero disk latency.
  • shared read=8000: 8,000 blocks had to be fetched from physical disk or OS filesystem cache.
Related Concepts: #EXPLAIN BUFFERS #Shared Buffers #IO Performance