pg_stats: How Postgres Internal Stats Work | POSETTE: An Event for Postgres 2026
Postgresql Pg_stats Query optimizer Query planning Database optimization Postgres performance Histograms Extended statistics Postgresql internals Database performance tuning
This talk explains how PostgreSQL's internal statistics system drives query planning decisions, covering the pg_stats view, histograms, MCV lists, and correlation values. Richard Yen demonstrates how the planner uses these statistics to estimate row counts and choose between sequential and index scans, plus introduces Extended Statistics for fixing bad plans on correlated columns like City and State. Ideal for DBAs and developers looking to debug and optimize PostgreSQL query performance.