From edba754f052ea0c02287080004aa6051eaa4f597 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Tue, 18 Mar 2025 16:32:56 -0500 Subject: vacuumdb: Add option for analyzing only relations missing stats. This commit adds a new --missing-stats-only option that can be used with --analyze-only or --analyze-in-stages. When this option is specified, vacuumdb will analyze a relation if it lacks any statistics for a column, expression index, or extended statistics object. This new option is primarily intended for use after pg_upgrade (since it can now retain most optimizer statistics), but it might be useful in other situations, too. Author: Corey Huinker Co-authored-by: Nathan Bossart Reviewed-by: John Naylor Discussion: https://postgr.es/m/Z5O1bpcwDrMgyrYy%40nathan --- doc/src/sgml/ref/vacuumdb.sgml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml index 66fccb30a2d..d102f9d4840 100644 --- a/doc/src/sgml/ref/vacuumdb.sgml +++ b/doc/src/sgml/ref/vacuumdb.sgml @@ -277,6 +277,22 @@ PostgreSQL documentation + + + + + Only analyze relations that are missing statistics for a column, index + expression, or extended statistics object. This option prevents + vacuumdb from deleting existing statistics + so that the query optimizer's choices do not become transiently worse. + + + This option can only be used in conjunction with + or . + + + + -- cgit v1.2.3