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

Sajith Prabhakar Shetty <ssajith@blackduck.com>

From: Sajith Prabhakar Shetty <ssajith@blackduck.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2025-05-15T16:21:10Z
Lists: pgsql-bugs

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Convert strategies to and from compare types

  2. Enhance nbtree ScalarArrayOp execution.

  3. Improve planning of btree index scans using ScalarArrayOpExpr quals.

  4. Fix planning of btree index scans using ScalarArrayOpExpr quals.

Hi Tom,

Thanks for the response.

In my first test, I used pg_upgrade to upgrade the instance from 15 to 17, and in my second test, I created PG15 and PG17 separately from brew repo, I don’t think I am using debug build here.



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


From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Thursday, 15 May 2025 at 9:16 PM
To: Sajith Prabhakar Shetty <ssajith@blackduck.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: Postgres: Queries are too slow after upgrading to PG17 from PG15
Sajith Prabhakar Shetty <ssajith@blackduck.com> writes:
> Now surprisingly one of the query i took from application which used to execute in 2s in PG15, is now taking 1min+ in PG17.

The data you've actually showed us does not back up that complaint.
But I do see a 2x slowdown.

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

Yeah, that is odd.  The only simple explanation I can think of is that you
are using a debug build of v17.

                        regards, tom lane