~/talk

Enhancing Planner Estimates with Extended Statistics in PostgreSQL

Talkat PGConf India 2025 · 2025-03-05..03-07· [databases, web-performance]
links:none on file
slides:none on file

PostgreSQL shows large estimation errors on correlated columns; creating CREATE STATISTICS on the specific column pair and running ANALYZE moves an estimate from ~20 rows to ~19k (actual ~100k), and a simple predicate already reads ~99k vs 100k. An aggregate was overestimated by about 100x until an ndistinct stats was added and reanalyzed. Extended statistics improve planner selectivity for correlated and high‑cardinality columns; they do not apply to join queries, so rewrite joins if estimates remain wrong.

AI-written summary · about

~/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.