Re: analyze-in-stages post upgrade questions

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Nathan Bossart <nathandbossart(at)gmail(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Mircea Cadariu <cadariu(dot)mircea(at)gmail(dot)com>, "Zechman, Derek S" <Derek(dot)S(dot)Zechman(at)snapon(dot)com>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: analyze-in-stages post upgrade questions
Date: 2026-08-06 14:30:43
Message-ID: 87BC0949-448C-4B84-8B47-7D044F87B9C9@yesql.se
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> On 16 Jul 2026, at 04:53, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>
> On Thu, Jul 16, 2026 at 12:42 AM Nathan Bossart
> <nathandbossart(at)gmail(dot)com> wrote:
>>
>> [RMT hat]
>>
>> On Thu, Jun 04, 2026 at 12:14:34PM -0500, Justin Pryzby wrote:
>>> Checking back.
>>>
>>> On Wed, Aug 20, 2025 at 08:51:16PM -0500, Justin Pryzby wrote:
>>>> When analyzing a partitioned table, I think you should use ANALYZE ONLY,
>>>> or otherwise avoid processing the children twice.
>>
>> This is listed as an open item for v19 [0].
>
> Thanks for pointing this out!
>
>> Is it appropriate to consider
>> this v19 stabilization work?
>
> Yes, probably. The attached patch updates vacuumdb to use ANALYZE ONLY
> for partitioned tables when --analyze-only or --analyze-in-stages is
> specified, as suggested.

I had a look at this open item today and the proposal and patch looks good to
me. Just one small comment: don't we need a check for the applicable server
version (as per the attached v2) before issuing ANALYZE ONLY since it's not
supported in all versions?

--
Daniel Gustafsson

Attachment Content-Type Size
v2-0001-vacuumdb-Use-ANALYZE-ONLY-for-partitioned-tables.patch application/octet-stream 12.8 KB

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Verite 2026-08-06 14:39:00 Re: ICU database?
Previous Message Greg Sabino Mullane 2026-08-06 13:46:01 Re: ICU database?

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2026-08-06 14:31:44 Re: WAL compression setting after PostgreSQL LZ4 default change
Previous Message Amit Langote 2026-08-06 14:11:54 Re: RI fast path gets cross-type foreign keys wrong