On Mon, 16 Feb 2026 at 16:49, Clive Boughton <[email protected]> wrote: > When I recently upgraded to PG 18.1 (without any changes to the DB functions > or tables, or indexing) it took 7-10 hours to 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 the code 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
