~/talk

Explaining the Postgres Query Optimizer

Talkat Citus Con: An Event for Postgres 2022 · 2022-04-12..04-13· [databases]
slides:none on file

Explains how PostgreSQL chooses sequential, bitmap or index scans and when it picks nested loop, hash or merge joins, using EXPLAIN on temporary sample tables built from pg_class and pg_proc with a 78% skew on one value. Shows that missing optimizer stats makes the planner use bad index plans, that running ANALYZE fixes bad plans, that LIMIT changes join strategy, and that multi‑column or extended statistics (Tomas Vondra’s work) and raising stats_target are the practical fixes demonstrated.

AI-written summary · about

  1. 0:00Introduction
  2. 2:10What is the query optimizer?
  3. 3:53Choices the query optimizer needs to make
  4. 4:19Scan methods: sequential, bitmap index, & index
  5. 12:13Join methods & join order
  6. 21:18Conclusion
  7. 23:22Q&A with Bruce & Marco
~/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.