Conceptual
Login

Table Statistics

The database samples each table to record row count, per-column distinct-value counts, most-common values with frequencies, and histograms; ANALYZE (or auto-analyze) refreshes them. These numbers are the optimizer's only knowledge of the data, so stale statistics after a bulk load are a classic cause of sudden plan regressions.

Questions this Concept answers

  • Why does the planner rely on a sampled statistical sketch instead of counting matching rows before it plans?