analyze-in-stages post upgrade questions

Zechman, Derek S <derek.s.zechman@snapon.com>

From: "Zechman, Derek S" <Derek.S.Zechman@snapon.com>
To: "pgsql-general@lists.postgresql.org" <pgsql-general@lists.postgresql.org>
Date: 2025-06-27T13:35:27Z
Lists: pgsql-hackers, 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

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. vacuumdb: Make vacuumdb --analyze-only process partitioned tables.

  2. Integrate FullTransactionIds deeper into two-phase code