~/talk

Understanding PostgreSQL Query Plans (aka EXPLAIN)

Talkat PGConf NYC 2022 · 2022-09-22..09-23· [databases]
links:none on file
slides:none on file

Shows how to read EXPLAIN and EXPLAIN ANALYZE outputs, what EXPLAIN ANALYZE with buffers and io timing reveals about shared hits versus OS reads, and how planning vs execution time differ. Demonstrates tuning knobs: adjust work_mem × hash_mem_multiplier to avoid hash-join batching to disk, toggle enable_ options to force alternate plans, and use VACUUM/ANALYZE or extended statistics to fix wildly wrong row estimates. Introduces the memoize node (PG14/15)* for repeated parameterized nested-loop lookups and points to explain.depes.com for visual analysis.

AI-written summary · about

  1. 0:00Introduction and welcome
  2. 0:50What is a query plan
  3. 3:20Costing in PostgreSQL plans
  4. 6:30EXPLAIN options and planning time
  5. 9:06Running queries with EXPLAIN ANALYZE
  6. 12:23Retrieving data nodes
  7. 18:22Join types in PostgreSQL
  8. 22:13Aggregate operations
  9. 23:38Parallel query nodes
  10. 27:08Bitmap and materialized nodes
  11. 31:26Memoize and other nodes
  12. 33:13Statistics and query optimization
  13. 37:25Analyzing join plans
  14. 40:33EXPLAIN ANALYZE with buffers
  15. 42:16Parallel plan details
  16. 44:24Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.