Re: A serious change in performance between PG 15 and PG 16, 17, 18. - Mailing list pgsql-performance

From David Rowley
Subject Re: A serious change in performance between PG 15 and PG 16, 17, 18.
Date
Msg-id CAApHDvrFhD9Ezi3qE60H77NV6qoQ4gkH7_+2GnbhnHy5EKQFWA@mail.gmail.com
Whole thread
In response to A serious change in performance between PG 15 and PG 16, 17, 18.  (Clive Boughton <clive.boughton@softimp.com.au>)
List pgsql-performance
On Mon, 16 Feb 2026 at 16:49, Clive Boughton
<clive.boughton@softimp.com.au> wrote:
> When I recently upgraded to PG 18.1 (without any changes to the DB functions or tables, or indexing) it took 7-10
hoursto produce the same result - a 300-600 times decrease in performance.
 

> For reasons of security I can't provide all the SQL code, but I can (if it is necessary) provide an outline of what
thecode does.
 

It will be necessary to provide more than you have done so far.
There's just no way anyone could guess what might be happening based
on what you've provided.

I suggest looking at the EXPLAIN output and seeing if there's a plan
change between the versions. Perhaps the newer version is considering
a plan shape that previously wasn't considered, and that turns out not
to be great due to some estimation problem. I suspect if you're seeing
300-600x slowdown, then it's pretty unlikely to be the same plan.

It'd be good if you could share the EXPLAIN (ANALYZE, BUFFERS) from
before and after the upgrade.

Perhaps the issue is just that you didn't run ANALYZE after a pg_upgrade.

David



pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: A serious change in performance between PG 15 and PG 16, 17, 18.
Next
From: "David G. Johnston"
Date:
Subject: Re: A serious change in performance between PG 15 and PG 16, 17, 18.