diff options
author | Nathan Bossart <nathan@postgresql.org> | 2025-02-04 15:07:54 -0600 |
---|---|---|
committer | John Naylor <john.naylor@postgresql.org> | 2025-03-07 10:17:35 +0700 |
commit | 5f8eb25706b62923c53172e453c8a4dedd877a3d (patch) | |
tree | cb293d4335eeb54b12153444b267b28eaba3465e /doc/src | |
parent | e2080261cc8c1a962708843dc4c806e19fb2c44e (diff) | |
download | postgresql-5f8eb25706b62923c53172e453c8a4dedd877a3d.tar.gz postgresql-5f8eb25706b62923c53172e453c8a4dedd877a3d.zip |
vacuumdb: Add option for analyzing only relations missing stats.
This commit adds a new --missing-only option that can be used in
conjunction with --analyze-only and --analyze-in-stages. When this
option is specified, vacuumdb will generate ANALYZE commands for a
relation if it is missing any statistics it should ordinarily have.
For example, if a table has statistics for one column but not
another, we will analyze the whole table. A similar principle
applies to extended statistics, expression indexes, and table
inheritance.
Co-authored-by: Corey Huinker <corey.huinker@gmail.com>
Reviewed-by: TODO
Discussion: https://postgr.es/m/Z5O1bpcwDrMgyrYy%40nathan
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/vacuumdb.sgml | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml index 66fccb30a2d..5295a61f083 100644 --- a/doc/src/sgml/ref/vacuumdb.sgml +++ b/doc/src/sgml/ref/vacuumdb.sgml @@ -278,6 +278,22 @@ PostgreSQL documentation </varlistentry> <varlistentry> + <term><option>--missing-only</option></term> + <listitem> + <para> + Only analyze relations that are missing statistics for a column, index + expression, or extended statistics object. This option prevents + <application>vacuumdb</application> from deleting existing statistics + so that the query optimizer's choices do not become transiently worse. + </para> + <para> + This option can only be used in conjunction with + <option>--analyze-only</option> and <option>--analyze-in-stages</option>. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><option>-n <replaceable class="parameter">schema</replaceable></option></term> <term><option>--schema=<replaceable class="parameter">schema</replaceable></option></term> <listitem> |