| From: | Andrei Lepikhov <lepihov(at)gmail(dot)com> |
|---|---|
| To: | Attila Soki <atiware(at)gmx(dot)net> |
| Cc: | pgsql-performance(at)postgresql(dot)org, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> |
| Subject: | Re: unstable query plan on pg 16,17,18 |
| Date: | 2026-02-24 11:09:43 |
| Message-ID: | 0dd76506-053e-4a30-9f95-9dc324e8e1fb@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-performance |
On 24/2/26 10:16, Attila Soki wrote:
> On 23 Feb 2026, at 21:25, Andrei Lepikhov <lepihov(at)gmail(dot)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
This update gives us more useful details. In PG14, the join search
problem involved at most 9 relations. In PG19, the maximum is now 18
joins. Do you know what your join_collapse_limit is set to? It looks
like subplan pull-ups have made things more complex.
First, we should look into any possible 'rescan cost' issues on our side
as developers.
On your end, please check the join_collapse_limit setting. If needed,
try increasing it to around 20. This might help.
--
regards, Andrei Lepikhov,
pgEdge
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Attila Soki | 2026-02-24 11:37:17 | Re: unstable query plan on pg 16,17,18 |
| Previous Message | Attila Soki | 2026-02-24 09:16:08 | Re: unstable query plan on pg 16,17,18 |