]> git.ipfire.org Git - thirdparty/postgresql.git/commit
vacuumdb: Fix --analyze-in-stages skipping partitioned tables
authorFujii Masao <fujii@postgresql.org>
Wed, 3 Jun 2026 07:53:16 +0000 (16:53 +0900)
committerFujii Masao <fujii@postgresql.org>
Wed, 3 Jun 2026 07:53:16 +0000 (16:53 +0900)
commit95b6ec52e684e5de743e5bf4a2303f6cac466682
tree514a10ceb5b0d21262436ce3776104383eb51380
parent273a3c77615e793089b2f41b666b6fcaa970a0c9
vacuumdb: Fix --analyze-in-stages skipping partitioned tables

Commit 6429e5b77 changed vacuumdb to process partitioned tables when
--analyze-only or --analyze-in-stages is specified, matching the
documented behavior of analyzing regular tables, partitioned tables,
and materialized views.

Later, commit c4067383cb2 accidentally changed this behavior so that
partitioned tables were processed for --analyze-only, but skipped for
--analyze-in-stages.

As a result, vacuumdb --analyze-in-stages no longer matched its
documentation. Partitioned tables were skipped, leaving parent-table
statistics outdated even though users running vacuumdb
--analyze-in-stages after pg_upgrade, restore, or bulk loading would
expect statistics to be rebuilt for the database.

Fix this issue by making --analyze-in-stages process partitioned
tables again.

Author: Chao Li <lic@highgo.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/EDFF0AFB-050F-4FBF-8D4F-B44DC454D957@gmail.com
src/bin/scripts/t/100_vacuumdb.pl
src/bin/scripts/vacuuming.c