pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christophe Pettus <xof@thebuild.com>
To: 赖锦辉 <jh.lai@qq.com>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #18905: The opposite WHERE clause intersects and is always an empty set. It should perform no action.
Date: Sun, 27 Apr 2025 12:19:59 -0700
Message-ID: <2D956CA2-F876-48BA-B12E-FB9FD81F4AE5@thebuild.com> (raw)
In-Reply-To: <tencent_47C0CAC405AB8FF03DADC3B5ED82151EF506@qq.com>
References: <18905-f17e775841805cda@postgresql.org>
	<CAKFQuwZQB2=CRdqd1rT8cs+ziUjnDCbbnNot-UzyMBypDUkA+A@mail.gmail.com>
	<tencent_47C0CAC405AB8FF03DADC3B5ED82151EF506@qq.com>



> On Apr 27, 2025, at 10:54, 赖锦辉 <jh.lai@qq.com> wrote:
> But I don't believe this optimization is meaningless.

I don't believe anyone claims this is "meaningless."

Every condition the planner has to check for adds complexity and time to the planner.  If this will provide a significant improvement in plans for a reasonable number of real-life cases, then it might well be worth it.  This is especially true when there is no way of writing the query without running into the issue.

However, many proposed improvements optimize for a relatively uncommon case, but would add time and complexity for all queries.  In this case, it appears that this case is relatively uncommon, and it can be easily fixed by rewriting the query.  Given that the project does not have infinite resources to dedicate to planner improvements, it does not seem to be an area that would reward the work put into it.




view thread (4+ messages)

Message-ID: <2D956CA2-F876-48BA-B12E-FB9FD81F4AE5@thebuild.com>
Permalink:  ../2D956CA2-F876-48BA-B12E-FB9FD81F4AE5@thebuild.com/
Also on:    postgresql.org/message-id/2D956CA2-F876-48BA-B12E-FB9FD81F4AE5@thebuild.com

 · 

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: xof@thebuild.com, jh.lai@qq.com, david.g.johnston@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18905: The opposite WHERE clause intersects and is always an empty set. It should perform no action.
  In-Reply-To: <2D956CA2-F876-48BA-B12E-FB9FD81F4AE5@thebuild.com>

* 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