pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vik Fearing <vik@postgresfriends.org>
To: Christophe Pettus <xof@thebuild.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: jinhui.lai@qq.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19059: PostgreSQL fails to evaluate the cheaper expression first, leading to 45X performance degradation
Date: Sun, 21 Sep 2025 11:09:02 +0200
Message-ID: <f5ab4542-acfa-4939-a6aa-0e42b69bb46a@postgresfriends.org> (raw)
In-Reply-To: <84B5D601-C007-4B07-9ECB-CDD06E47B949@thebuild.com>
References: <19059-c751eed385314309@postgresql.org>
	<2510592.1758403162@sss.pgh.pa.us>
	<84B5D601-C007-4B07-9ECB-CDD06E47B949@thebuild.com>


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. "

-- 

Vik Fearing

view thread (6+ messages)  latest in thread

Message-ID: <f5ab4542-acfa-4939-a6aa-0e42b69bb46a@postgresfriends.org>
Permalink:  ../f5ab4542-acfa-4939-a6aa-0e42b69bb46a@postgresfriends.org/
Also on:    postgresql.org/message-id/f5ab4542-acfa-4939-a6aa-0e42b69bb46a@postgresfriends.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: vik@postgresfriends.org, xof@thebuild.com, tgl@sss.pgh.pa.us, jinhui.lai@qq.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #19059: PostgreSQL fails to evaluate the cheaper expression first, leading to 45X performance degradation
  In-Reply-To: <f5ab4542-acfa-4939-a6aa-0e42b69bb46a@postgresfriends.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox