mirror of
https://github.com/postgres/postgres.git
synced 2025-10-16 17:07:43 +03:00
vacuumdb: Make vacuumdb --analyze-only process partitioned tables.
vacuumdb should follow the behavior of the underlying VACUUM and ANALYZE commands. When --analyze-only is used, it ought to analyze regular tables, materialized views, and partitioned tables, just as ANALYZE (with no explicit target tables) does. Otherwise, it should only process regular tables and materialized views, since VACUUM skips partitioned tables when no targets are given. Previously, vacuumdb --analyze-only skipped partitioned tables. This was inconsistent, and also inconvenient after pg_upgrade, where --analyze-only is typically used to gather missing statistics. This commit fixes the behavior so that vacuumdb --analyze-only also processes partitioned tables. As a result, both vacuumdb --analyze-only and ANALYZE (with no explicit targets) now analyze regular tables, partitioned tables, and materialized views, but not foreign tables. Because this is a nontrivial behavior change, it is applied only to master. Reported-by: Zechman, Derek S <Derek.S.Zechman@snapon.com> Author: Laurenz Albe <laurenz.albe@cybertec.at> Co-authored-by: Mircea Cadariu <cadariu.mircea@gmail.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Discussion: https://postgr.es/m/CO1PR04MB8281387B9AD9DE30976966BBC045A%40CO1PR04MB8281.namprd04.prod.outlook.com
This commit is contained in:
@@ -397,6 +397,15 @@ PostgreSQL documentation
|
||||
Multiple tables can be vacuumed by writing multiple
|
||||
<option>-t</option> switches.
|
||||
</para>
|
||||
<para>
|
||||
If no tables are specified with the <option>--table</option> option,
|
||||
<application>vacuumdb</application> will clean all regular tables
|
||||
and materialized views in the connected database.
|
||||
If <option>--analyze-only</option> or
|
||||
<option>--analyze-in-stages</option> is also specified,
|
||||
it will analyze all regular tables, partitioned tables,
|
||||
and materialized views (but not foreign tables).
|
||||
</para>
|
||||
<tip>
|
||||
<para>
|
||||
If you specify columns, you probably have to escape the parentheses
|
||||
|
Reference in New Issue
Block a user