pgsql: vacuumdb: Do not run VACUUM (ONLY_DATABASE_STATS) when --analyze

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: vacuumdb: Do not run VACUUM (ONLY_DATABASE_STATS) when --analyze
Date: 2025-09-24 16:39:39
Message-ID: E1v1SWo-002LFL-2W@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

vacuumdb: Do not run VACUUM (ONLY_DATABASE_STATS) when --analyze-only.

Previously, vacuumdb --analyze-only issued VACUUM (ONLY_DATABASE_STATS)
at the end. Since --analyze-only is meant to update optimizer statistics only,
this extra VACUUM command is unnecessary.

This commit prevents vacuumdb --analyze-only from running that redundant
VACUUM command.

Author: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Reviewed-by: Mircea Cadariu <cadariu(dot)mircea(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAHGQGwEqHGa-k=wbRMucUVihHVXk4NQkK94GNN=ym9cQ5HBSHg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/879c492480d0e9ad8155c4269f95c5e8add41901

Modified Files
--------------
src/bin/scripts/t/100_vacuumdb.pl | 6 ++++++
src/bin/scripts/vacuumdb.c | 3 ++-
2 files changed, 8 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-09-24 19:56:57 pgsql: doc: Remove trailing whitespace in xref
Previous Message Melanie Plageman 2025-09-24 16:30:50 pgsql: Correct prune WAL record opcode name in comment