pgconfigurator
pgconfigurator

default_statistics_target

No restart — settable per sessiontuned by pgconfiguratorcount (histogram buckets / MCVs)

How much detail ANALYZE collects for column statistics.

What pgconfigurator would set
32 GB · 8 vCPU · NVMe · OLTP
Computing…
Tune for your exact server → /tunecomputed in your browser · nothing uploaded

What it does

default_statistics_target sets how many most-common-values and histogram buckets ANALYZE gathers per column. More detail gives the planner better selectivity estimates — important for skewed data — at the cost of slower ANALYZE and a bit more planning time.

How to tune it

The default 100 suits most columns. For large tables with skewed or many distinct values where the planner mis-estimates row counts, raise it (per-column via ALTER TABLE … ALTER COLUMN … SET STATISTICS is often better than globally). Re-run ANALYZE after changing it.

What the analyzer flags

  • Bad row estimate — better statistics often fix the estimate

Paste a plan into the analyzer →

FAQ

Will raising default_statistics_target fix bad row estimates?
Often, for single-column skew. For correlations between columns, extended statistics (CREATE STATISTICS) usually helps more. Either way, run ANALYZE afterward so the new targets take effect.

Related parameters