linkend="sql-analyze" endterm="sql-analyze-title"> on each
- database so the query optimizer has useful statistics. An easy way
- to do this is to run vacuumdb -a -z>; this is
- equivalent to running VACUUM ANALYZE> on each database
- manually. For more advice on how to load large amounts of data
+ database so the query optimizer has useful statistics;
+ see
+ and for more information.
+ For more advice on how to load large amounts of data
into
PostgreSQL> efficiently, refer to
linkend="populate">.
-
+
Indexes
real statistics, some default values are assumed, which are
almost certain to be inaccurate. Examining an application's
index usage without having run ANALYZE is
- therefore a lost cause.
+ therefore a lost cause.
+ See
+ and for more information.
-
+
Routine Database Maintenance Tasks
-
Updating Planner Statistics
+
id="vacuum-for-statistics-title">Updating Planner Statistics
-
+
Performance Tips
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.
+ statistics. Note that if the autovacuum daemon is enabled, it might
+ run ANALYZE automatically; see
+
+ and for more information.
while loading the data, but don't bother increasing
maintenance_work_mem; rather, you'd do that while
manually recreating indexes and foreign keys afterwards.
- And don't forget to ANALYZE> when you're done.
+ And don't forget to ANALYZE> when you're done; see
+
+ and for more information.
does not contain the statistics used by the optimizer to make
query planning decisions. Therefore, it is wise to run
ANALYZE after restoring from a dump file
- to ensure good performance. The dump file also does not
+ to ensure good performance; see
+ and for more information.
+ The dump file also does not
contain any ALTER DATABASE ... SET> commands;
these settings are dumped by ,
along with database users and other installation-wide settings.
-
+
Once restored, it is wise to run ANALYZE> on each
- restored table so the optimizer has useful statistics.
+ restored table so the optimizer has useful statistics; see
+ and
+ for more information.