Glossary — in plain language

pg_statistic and pg_stats

Also called: the statistics catalog, pg_stats view

In plain English

pg_statistic is the system catalog where ANALYZE stores the statistical portrait of every column. pg_stats is a friendly view on top of it that you can actually read in plain SQL.

Why it matters

This is where you look to see exactly what the planner believes about your data — null fraction, common values, histogram, n_distinct, correlation. Reading pg_stats is the fastest way to find the column whose bad statistics are causing a slow query.

Was this helpful?

← Browse the full glossary