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

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Sajith Prabhakar Shetty <ssajith@blackduck.com>
Cc: "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2025-05-15T15:46:31Z
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.

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