| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Kirill Reshke <reshkekirill(at)gmail(dot)com> |
| Cc: | Manu <manuelreyesbravo(at)gmail(dot)com>, Tender Wang <tndrwang(at)gmail(dot)com>, Richard Guo <guofenglinux(at)gmail(dot)com>, idrissaajalloh(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org |
| Subject: | Re: BUG #19861: Self-join elimination drops a VOLATILE predicate and changes the query result |
| Date: | 2026-12-06 04:08:09 |
| Message-ID: | 377071.1796530089@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
Kirill Reshke <reshkekirill(at)gmail(dot)com> writes:
> On Sun, 6 Dec 2026 at 08:03, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I want to push back hard against the idea that we promise anything
>> about "how many times or in which order" qual clauses run; see the
>> explicit documentation to the contrary in [1].
> Yeah, I want to drop my objection from [0]. For volatile functions,
> number of calls should not prevent optimizations
> [0] https://www.postgresql.org/message-id/CALdSSPgFzGF2oxJF5OxjoaKe82JqA7T1w9Sb8A_9UrqEzjErCQ%40mail.gmail.com
Just to clarify: I think we *do* try to preserve predictable semantics
for volatile functions in targetlists; the documented disclaimer is
only about WHERE/JOIN clauses. So the business about unifying
textually-identical tlist items even if they're volatile does seem
like a bug to me. But, as noted upthread, that's of long standing
and it happens in some non-SJE cases too.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Manu | 2026-12-06 04:26:50 | Re: BUG #19861: Self-join elimination drops a VOLATILE predicate and changes the query result |
| Previous Message | Kirill Reshke | 2026-12-06 03:55:17 | Re: BUG #19861: Self-join elimination drops a VOLATILE predicate and changes the query result |