public inbox for [email protected]  
help / color / mirror / Atom feed
From: Zechman, Derek S <[email protected]>
To: Laurenz Albe <[email protected]>
To: Adrian Klaver <[email protected]>
To: [email protected] <[email protected]>
Subject: RE: analyze-in-stages post upgrade questions
Date: Wed, 9 Jul 2025 11:30:22 +0000
Message-ID: <PH0PR04MB8294E796D6297D4E3BE4EFB6C049A@PH0PR04MB8294.namprd04.prod.outlook.com> (raw)
In-Reply-To: <[email protected]>
References: <CO1PR04MB8281387B9AD9DE30976966BBC045A@CO1PR04MB8281.namprd04.prod.outlook.com>
	<[email protected]>
	<[email protected]>
	<PH0PR04MB82943D67CD179002714AA503C044A@PH0PR04MB8294.namprd04.prod.outlook.com>
	<[email protected]>

> > Well, that wouldn't explain why it doesn't work on partitioned tables.

> > I am under the impression that it should.

> >

> > Derek, can cou share the pg_stats entries for the partitioned table?

>

> There are no entries in pg_stats for the parent table until after I manually run an analyze on it – Example below



You are right.  I looked at the code, and "vacuumdb" does not process

partitiond tables, even if --analyze-only is specified.  I find that

surprising, aince the SQL command ANALYZE (without a table name) will

also collect statistics for partitioned tables.



I think that it would be a good idea to change that behavior.

In particular, it makes a lot of sense to collect statistics for

partitioned tables after a "pg_upgrade".



Attached is a patch to make "vacuumdb --analyze-only" consider

partitioned tables as well.



Yours,

Laurenz Albe



Is there a plan to include this patch in future releases/patches of postgres?



Thanks,

(Derek) Sean


view thread (2+ 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]
  Subject: RE: analyze-in-stages post upgrade questions
  In-Reply-To: <PH0PR04MB8294E796D6297D4E3BE4EFB6C049A@PH0PR04MB8294.namprd04.prod.outlook.com>

* 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