← notes

Postgres EXPLAIN, in ten lines

Updated Apr 11, 2026· #postgres #snippet
EXPLAIN (ANALYZE, BUFFERS, VERBOSE, FORMAT TEXT) <query>;
  • Seq Scan: full table read. Fine on small tables.
  • Index Scan: uses an index; still fetches rows.
  • Index Only Scan: served from the index alone.
  • Bitmap Heap Scan: combines multiple indexes.
  • Rows Removed by Filter: index didn't cover the predicate.
  • Buffers: shared read: cold cache; consider warm-up.