Re: unstable query plan on pg 16,17,18

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 19:20:29
Message-ID: CAMMNXXnWxgaYYn0xEH36do=UWG_3a47Qq9cyvQ6MucGHh9c=Qw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 24/2/26 17:48, Attila Soki wrote:
>> On 24 Feb 2026, at 16:57, Andrei Lepikhov <lepihov(at)gmail(dot)com> wrote:
>> On 24/2/26 16:50, Attila Soki wrote:
> I can provide more details on other parts of the query too, if that helps.

Only query and reproduction make sense for me to discover more deeply at
the moment.
It looks like we have managed to reproduce the potential 'Hash over
parameterised subtree' issue. Please check the attachment: there are two
plans. One plan has a longer execution time and more blocks hit, but its
cost estimate is four times lower. The EXPLAIN output does not show any
obvious estimation errors. This suggests there may be a bug in the cost
model.

--
regards, Andrei Lepikhov,
pgEdge

Attachment Content-Type Size
parameterized_hash_demo.sql application/sql 5.6 KB

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Feike Steenbergen 2026-02-25 16:35:34 Re: MERGE INTO... WHEN NOT MATCHED BY SOURCE index usage
Previous Message Attila Soki 2026-02-24 16:48:15 Re: unstable query plan on pg 16,17,18