Re: vacuumdb: add --dry-run

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Cc: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: vacuumdb: add --dry-run
Date: 2025-12-04 21:52:03
Message-ID: aTICg5LV0Nl6khYj@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 20, 2025 at 04:16:13PM -0600, Nathan Bossart wrote:
> On Thu, Nov 20, 2025 at 05:09:54PM -0500, Corey Huinker wrote:
>> I have no objections to, but I am curious about the factors that went into
>> making dry_run an independent boolean rather than part of vacopts.
>
> My thinking was that it's closer to "echo" and "quiet" than anything in
> vacuumingOptions. Most of that stuff seems geared towards controlling the
> precise behavior of the commands rather than the behavior of the
> application. TBH I think it'd be fine either way. We could probably even
> move "echo" and "quiet" into vacuumingOptions if we really wanted to.

Yeah, I'm finding myself liking the idea of moving all of these things into
vacuumingOptions so that we don't have to cart around so many bool
arguments. Here's a new patch set that does it this way.

The remaining question in my mind is where we should let the user know that
we're in dry-run mode. The three options I see are 1) at the beginning of
vacuumdb execution, 2) in the !quiet block for each database, and 3) in
each command (via a comment). In v5, I've added a message to all three,
but I'm eager to hear what folks think.

--
nathan

Attachment Content-Type Size
v5-0001-Move-some-vacuumdb-options-to-vacopts-struct.patch text/plain 9.1 KB
v5-0002-Add-ParallelSlotSetIdle.patch text/plain 1.6 KB
v5-0003-Add-dry-run-to-vacuumdb.patch text/plain 7.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-12-04 22:09:30 More const-marking cleanup
Previous Message Hannu Krosing 2025-12-04 21:21:29 Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?