postgresql_16:3.11.4.8 Run ANALYZE Afterwards
PostgreSQL 16 > The SQL Language > Performance Tips > Populating a Database > Run ANALYZE Afterwards
Whenever you have significantly altered the distribution of data within a table, running ANALYZE (see postgresql_16:7.1.44) is strongly recommended. This includes bulk loading large amounts of data into the table. Running ANALYZE (or VACUUM ANALYZE) ensures that the planner has up-to-date statistics about the table. With no statistics or obsolete statistics, the planner might make poor decisions during query planning, leading to poor performance on any tables with inaccurate or nonexistent statistics. Note that if the autovacuum daemon is enabled, it might run ANALYZE automatically; see (see postgresql_16:4.10.1.3) and (see postgresql_16:4.10.1.6) for more information.