public inbox for [email protected]  
help / color / mirror / Atom feed
From: Laurenz Albe <[email protected]>
To: Fujii Masao <[email protected]>
To: Mircea Cadariu <[email protected]>
Cc: Zechman, Derek S <[email protected]>
Cc: Adrian Klaver <[email protected]>
Cc: [email protected]
Subject: Re: analyze-in-stages post upgrade questions
Date: Wed, 06 Aug 2025 22:52:52 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAHGQGwEj8PCk1OVveJ_F1sj_COrV95N-mfu_tLUn4gdcAM24kA@mail.gmail.com>
References: <CO1PR04MB8281387B9AD9DE30976966BBC045A@CO1PR04MB8281.namprd04.prod.outlook.com>
	<[email protected]>
	<[email protected]>
	<PH0PR04MB82943D67CD179002714AA503C044A@PH0PR04MB8294.namprd04.prod.outlook.com>
	<[email protected]>
	<PH0PR04MB8294E796D6297D4E3BE4EFB6C049A@PH0PR04MB8294.namprd04.prod.outlook.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAHGQGwEvwpydO7hjnB51Q2zgS0ydv31X4HCFLNzMeqLr=poS8w@mail.gmail.com>
	<[email protected]>
	<CAHGQGwEj8PCk1OVveJ_F1sj_COrV95N-mfu_tLUn4gdcAM24kA@mail.gmail.com>

On Wed, 2025-08-06 at 23:25 +0900, Fujii Masao wrote:
> On Wed, Aug 6, 2025 at 1:01 PM Mircea Cadariu <[email protected]> wrote:
> > Overall, I like the change. But I have one question: should this be treated as
> > a bug fix that we back-patch to supported branches, or is it more of
> > an improvement that should only go into master?
> > 
> > I reckon it might make sense to back-patch it to previous versions, as users might not upgrade always to the latest version.
> 
> I understand your point. But on second thought, since the patch changes
> behavior, I'm leaning toward treating it as an improvement, so it should
> only go to master...

I agree that this behavior change should not be backpatched.
That is not a bugfix.

> > + /*
> > + * VACUUMing partitioned tables would be unreasonably expensive, since
> > + * that entails processing the partitions twice (once as part of the
> > + * partitioned table, once as tables in their own right) for no
> > + * benefit. But if we only ANALYZE, collecting statistics for
> > + * partitioned tables is worth the effort.
> > + */
> > 
> > This is probably true. But isn't the main reason more about aligning with
> > the behavior of the underlying VACUUM and ANALYZE commands? As the vacuumdb
> > docs says, "There is no effective difference between vacuuming and analyzing
> > databases via this utility and via other methods for accessing the server.",
> > so its default target objects should match: VACUUM skips partitioned tables
> > by default, while ANALYZE includes them. If that's the case, maybe the comment
> > should reflect that instead.
> > 
> > I see what you mean. From that perspective, I wonder if we even need a comment there at all.
> 
> Or, if we keep it, though, I'd like to update it to something like
> the following:
> 
> --------------------
> vacuumdb should generally follow the behavior of the underlying
> VACUUM and ANALYZE commands. If analyze_only is true, process
> regular tables, materialized views, and partitioned tables, just like
> ANALYZE (with no specific target tables) does. Otherwise, process
> only regular tables and materialized views, since VACUUM skips
> partitioned tables when no target tables are specified.
> --------------------

I am fine with that suggestion.

Alternatively, my original comment could be amended with

  Besides, ANALYZE (without an option) processes partitioned tables, and
  "vacuumdb -Z" should behave like ANALYZE.

Yours,
Laurenz Albe






view thread (19+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: analyze-in-stages post upgrade questions
  In-Reply-To: <[email protected]>

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

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