Back to the Catalog
postgresql
sql
performance
explain
indexes
query-planner
transactions
pagination

PostgreSQL Performance: Read the Query Plan

30 questions

Thirty questions about diagnosing PostgreSQL performance from real EXPLAIN ANALYZE output. Covers index design, sequential scans, cardinality estimates, composite-index order, locking, transaction isolation, and pagination. Assume default settings and a recent PostgreSQL major version unless a question says otherwise.

Questions

  1. Not answered. In cost=0.29..8.31, what do the two numbers mean?
  2. Not answered. How many rows did the inner index scan return in total?
  3. Not answered. What does the large Rows Removed by Filter count tell you here?
  4. Not answered. What does lossy=8134 mean in this bitmap heap scan, and how do you remove it?
  5. Not answered. Why does an Index Only Scan report Heap Fetches: 214938?
  6. Not answered. When is a sequential scan the right choice even though a usable index exists?
  7. Not answered. Which planner setting should you lower on SSD-backed storage to make index scans more competitive?
  8. Not answered. Which index serves this query best?
  9. Not answered. What does the INCLUDE (total) clause actually buy you?
  10. Not answered. Why does WHERE name LIKE 'Ann%' ignore the plain B-tree index on name?
  11. Not answered. Which index lets WHERE lower(email) = $1 use an index scan?
  12. Not answered. When will the planner actually use this partial index?
  13. Not answered. How many rows will the planner estimate for WHERE region_id = 7?
  14. Not answered. Why is this row estimate 300 times too low, and what actually fixes it?
  15. Not answered. Which node in this plan should you fix first?
  16. Not answered. What can you conclude from Sort Method: external merge Disk: 24800kB?
  17. Not answered. What does Batches: 8 mean in a hash join?
  18. Not answered. How many rows did this parallel scan read in total?
  19. Not answered. Why does page 5,000 of this listing take vastly longer than page 1?
  20. Not answered. Which WHERE clause correctly fetches the page after the row ('2026-03-01 10:00:00', 8412)?
  21. Not answered. What does keyset pagination require to be both correct and fast?
  22. Not answered. What is true of CREATE INDEX CONCURRENTLY?
  23. Not answered. Why did every read on the table freeze the moment this migration started?
  24. Not answered. What does FOR UPDATE SKIP LOCKED do for a job-queue worker?
  25. Not answered. What harm does a session sitting idle in transaction for hours do to query performance?
  26. Not answered. Why did adding one index slow down writes across the whole table?
  27. Not answered. What happens when you run EXPLAIN ANALYZE DELETE FROM orders WHERE created_at < '2020-01-01';?
  28. Not answered. What does Buffers: shared hit=142 read=88231 tell you?
  29. Not answered. How do READ COMMITTED and REPEATABLE READ differ when two transactions update the same row?
  30. Not answered. Why is this query instant for most users and catastrophic for a few?