analyze-in-stages post upgrade questions

From: "Zechman, Derek S" <Derek(dot)S(dot)Zechman(at)snapon(dot)com>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: analyze-in-stages post upgrade questions
Date: 2025-06-27 13:35:27
Message-ID: CO1PR04MB8281387B9AD9DE30976966BBC045A@CO1PR04MB8281.namprd04.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general


We recently performed an upgrade from pg14 (14.18) to pg16 (16.9) and performed the analyze-in-stages post upgrade. It has been noticed that some plans changed to use hash joins instead of nested loops. Further investigation found it was because the parent table of partitioned tables did not have stats. After running an ANALYZE on the parent tables we got similar plan an execution times as before.

I have two questions
1 - Why does analyze-in-stages not analyze the parent tables?
2 - What happens if we do not run analyze-in-stages post upgrade and just run an analyze?

Thanks,
Sean

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2025-06-27 13:41:39 Re: analyze-in-stages post upgrade questions
Previous Message David G. Johnston 2025-06-26 14:17:56 Re: Question about different behaviour in pg_wal when archive_mode is set on or off