~/talk

CREATE STATISTICS - what is it for

Talkat PGCon 2020 · 2020-05-26..05-29· [databases]
slides:none on file

Postgres 10 adds CREATE STATISTICS to collect multi‑column stats so the planner stops multiplying independent selectivities into nonsense: a 1.7 million‑row UK postcode table gives single‑column estimates like ~14,000 vs 13,889 actual, but a two‑column equality query falls to 115 vs ~12,000. functional dependencies raise the estimate toward ~9,200; n‑distinct coefficients cut a GROUP BY estimate from ~170,000 to ~13,221 and drop runtime from 1.5s to 0.4s; Postgres 12’s most common value lists can make some estimates exact. Future work targets expression stats and better join estimates.

AI-written summary · about

  1. 0:00Introduction to CREATE STATISTICS
  2. 1:17How PostgreSQL estimates row cardinalities
  3. 5:55Understanding EXPLAIN and estimates
  4. 11:20Correlated columns and estimation errors
  5. 15:37Consequences of estimation errors
  6. 19:33Introduction to extended statistics
  7. 21:22Functional dependencies explained
  8. 26:43Limitations of functional dependencies
  9. 29:35N-distinct coefficients for GROUP BY
  10. 34:19Fixing GROUP BY estimates with n-distinct
  11. 37:33Most common value lists in PostgreSQL 12
  12. 42:38Future improvements and Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.