Postgres: Queries are too slow after upgrading to PG17 from PG15

From: Sajith Prabhakar Shetty <ssajith(at)blackduck(dot)com>
To: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Postgres: Queries are too slow after upgrading to PG17 from PG15
Date: 2025-05-15 05:33:28
Message-ID: PH7PR19MB6481278D3A55C8BD04B9B9EDB590A@PH7PR19MB6481.namprd19.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

Most of the queries got slower after upgrading our postgres from version 15 to 17 using pg_upgrade. I reconfirmed that "vacuum full, analyze" were all taken care.

To debug, instead of upgrade, I installed two instances one with postgres 15 and another postgres 17 with the same application dump restored.

Now surprisingly one of the query i took from application which used to execute in 2s in PG15, is now taking 1min+ in PG17. I also observed that some of the operations involving DML operations slowed down too in PG17.

Explain plan of the two queries almost same, all the joins and paths used are exactly same.

Could anybody please provide some insights here?

PG15 Plan:

https://explain.depesz.com/s/5PGX

________________________________

PG17 Plan:

https://explain.depesz.com/s/27vD

Update: I installed PG16 with same dump, and verified that everything seems normal here in fact better than PG15, so i just want rule out possibility of PG16 impact here.

PG16 plan: https://explain.depesz.com/s/v0Gc

Sajith P Shetty
Principal Engineer
Black Duck
M +91 9448389989<tel:+919448389989>| ssajith(at)blackduck(dot)com<mailto:ssajith(at)blackduck(dot)com>
[signature_778616162]

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2025-05-15 07:26:12 BUG #18930: PostgreSQL fails to handle INTERSECT operation involving Empty Table
Previous Message PG Bug reporting form 2025-05-15 04:04:23 BUG #18929: After the view is created, executed query against the view definition, reported syntax error.