pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Antonin Houska <ah@cybertec.at>
To: alvherre@kurilemu.de
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: splitting src/bin/scripts/vacuumdb.c
Date: Fri, 26 Sep 2025 15:46:35 +0200
Message-ID: <48811.1758894395@localhost> (raw)
In-Reply-To: <202509261126.lqdaq6uvo2m2@alvherre.pgsql>
References: <202509261126.lqdaq6uvo2m2@alvherre.pgsql>

Álvaro Herrera <alvherre@kurilemu.de> wrote:

> - Two booleans, analyze_in_stages and analyze_only, are really
> determining what "mode" the program runs in -- it's either vacuum, or
> one of those two modes.  (Antonin came up with the idea of using
> "modes", but his patch only adds a new REPACK mode on top of the
> existing code without any further changes).  I think the code flow is a
> little neater by making this change; consider for instance this change:
> 
> -   /* If we used SKIP_DATABASE_STATS, mop up with ONLY_DATABASE_STATS */
> -   if (vacopts->skip_database_stats && stage == ANALYZE_NO_STAGE &&
> -       !vacopts->analyze_only)
> -   {
> 
> +   /* If we used SKIP_DATABASE_STATS, mop up with ONLY_DATABASE_STATS */
> +   if (vacopts->mode == MODE_VACUUM && vacopts->skip_database_stats)
> +   {
> 
> IMO the original is quite unclear.

I agree that redundant information makes things more difficult to think
about. I just wonder if

	vacopts->mode != MODE_VACUUM

should be used instead of

	(vacopts->mode == MODE_ANALYZE ||
	vacopts->mode == MODE_ANALYZE_IN_STAGES)

in some places. Nevertheless, I'm not proposing a global replacement: the
verbose form may be easier to understand, depending on the context.

Other than that, I checked differences between v21, v22 and v23. I've got no
other comments worth posting.

-- 
Antonin Houska
Web: https://www.cybertec-postgresql.com





view thread (5+ messages)  latest in thread

Message-ID: <48811.1758894395@localhost>
Permalink:  ../48811.1758894395@localhost/
Also on:    postgresql.org/message-id/48811.1758894395@localhost

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: ah@cybertec.at, alvherre@kurilemu.de, pgsql-hackers@lists.postgresql.org
  Subject: Re: splitting src/bin/scripts/vacuumdb.c
  In-Reply-To: <48811.1758894395@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox