Skip to content
masterclass Buddy

PostgreSQL · Command

ANALYZE

ANALYZE collects table statistics and saves them in pg_statistic. The query planner uses these statistics to choose efficient plans; PostgreSQL usually runs ANALYZE automatically through autovacuum.

Last updated

Syntax

ANALYZE [ ( option [, ...] ) ] [ table_and_columns [, ...] ]

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • EXPLAIN
  • VACUUM
  • vacuumdb
  • pg_stat_progress_analyze
  • default_statistics_target
  • ALTER TABLE ... ALTER COLUMN ... SET STATISTICS

Source: PostgreSQL: Documentation: 18: ANALYZE. Checked 2026-11-03.