Re: BUG #19059: PostgreSQL fails to evaluate the cheaper expression first, leading to 45X performance degradation - Mailing list pgsql-bugs

From Vik Fearing
Subject Re: BUG #19059: PostgreSQL fails to evaluate the cheaper expression first, leading to 45X performance degradation
Date
Msg-id f5ab4542-acfa-4939-a6aa-0e42b69bb46a@postgresfriends.org
Whole thread Raw
In response to Re: BUG #19059: PostgreSQL fails to evaluate the cheaper expression first, leading to 45X performance degradation  (Christophe Pettus <xof@thebuild.com>)
List pgsql-bugs


On 21/09/2025 00:54, Christophe Pettus wrote:
On Sep 20, 2025, at 14:19, Tom Lane <tgl@sss.pgh.pa.us> wrote:
While we've not gotten a huge amount of push-back about the top-level
re-ordering, there's been some complaints.  So I'm not eager to
propagate the idea further down.
And tangentially, doesn't the SQL standard make it implementation-defined if OR short-circuits or not?


Not that I can see.  The only implementation-defined mention in <boolean value expression> is:


"If the SQL-implementation supports Feature T101, “Enhanced nullability determination”, and if BVE conforms to an implementation-defined (IE011) rule that enables the SQL-implementation to correctly infer that, when BVE is True, then X cannot be null, then BVE is a known-not-null condition for X. p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica; color: #000000}p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #000000}p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 8.0px Helvetica; color: #b3b3b3}span.s1 {color: #00008e}span.s2 {color: #5c55ec}span.s3 {font: 10.0px Helvetica; color: #000000}"

-- 

Vik Fearing

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #19059: PostgreSQL fails to evaluate the cheaper expression first, leading to 45X performance degradation
Next
From: "Jinhui Lai"
Date:
Subject: Re: BUG #19059: PostgreSQL fails to evaluate the cheaper expression first, leading to 45X performance degradation