Re: reconsider_full_join_clause fails to consider if COALESCE() arguments are NULL-preserving

From: Tomas Vondra <tomas(at)vondra(dot)me>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: reconsider_full_join_clause fails to consider if COALESCE() arguments are NULL-preserving
Date: 2026-11-12 15:40:24
Message-ID: e0036b31-f9e8-4567-9860-60b0bbafdb55@vondra.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/12/26 16:18, Kirill Reshke wrote:
> On Thu, 12 Nov 2026 at 17:57, Tomas Vondra <tomas(at)vondra(dot)me> wrote:
>>
>> On 11/12/26 11:28, Tomas Vondra wrote:
>>>
>>> ...
>>>
>>> I suppose an expression walker that does not descend into PlaceHolderVar
>>> nodes (with phlevelsup = 0) would make this work correctly.
>>>
>> Here's v3 doing it that way.
>>
>> --
>> Tomas Vondra
>
> v3 looks totally fine for me, perf regressions from my report
> eliminated - good.
> There are maybe some more cases to recurce, but we shouldn't defer
> this bugs fix commit because of this. LGTM
>

True. I picked only a subset of nodes for v3, but I suspect it might be
expanded to the same set of nodes as contain_nonstrict_functions_walker
and check_functions_in_node. I don't know if all of them can appear in
the kind of quals we're processing.

This kind of clauses is not very common, so I was conservative. But it's
not great to cause a regression either ... I have to think about it.

regards

--
Tomas Vondra

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Strydom, Matthys 2026-11-12 15:49:29 RE: [PATCH] Report malformed integer aggregate states as array errors
Previous Message 신성준 2026-11-12 15:23:52 Re: Add wait events for server logging destination writes