Re: unstable query plan on pg 16,17,18 - Mailing list pgsql-performance

From Attila Soki
Subject Re: unstable query plan on pg 16,17,18
Date
Msg-id 1C445A2F-3256-4F04-B55D-9850581FF39A@gmx.net
Whole thread Raw
In response to Re: unstable query plan on pg 16,17,18  (Andrei Lepikhov <lepihov@gmail.com>)
Responses Re: unstable query plan on pg 16,17,18
List pgsql-performance
On 23 Feb 2026, at 21:25, Andrei Lepikhov <lepihov@gmail.com> wrote:
Thanks. But I meant your 'good' plan built by the PG14. I think a new feature invented later has added some problems.

Current conjecture is the following. As I see, the main problem is with Right Hash Join:
-> Hash Right Join (cost=210369.25..210370.30 rows=8 width=99)
Its inner side (Hash table) is rebuilt multiple times (around 1k) due to an external parameter (gauf_1.id) in the subtree. It looks like a disaster, and before I thought we don't build hash tables over parameterised query trees at all.

So, let me discover a little more, but your PG14 explain could add more details here.

Sorry, I misunderstood that.
here is the pg14.4 explain


Regards,
Attila

pgsql-performance by date:

Previous
From: Andrei Lepikhov
Date:
Subject: Re: unstable query plan on pg 16,17,18
Next
From: Andrei Lepikhov
Date:
Subject: Re: unstable query plan on pg 16,17,18