Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u97YM-00FfAL-7B for pgsql-bugs@arkaria.postgresql.org; Sun, 27 Apr 2025 19:20:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u97YJ-00AIIC-82 for pgsql-bugs@arkaria.postgresql.org; Sun, 27 Apr 2025 19:20:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u97YI-00AII3-VW for pgsql-bugs@lists.postgresql.org; Sun, 27 Apr 2025 19:20:35 +0000 Received: from smtp117.iad3b.emailsrvr.com ([146.20.161.117]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u97YG-002N7V-17 for pgsql-bugs@lists.postgresql.org; Sun, 27 Apr 2025 19:20:35 +0000 X-Auth-ID: xof@thebuild.com Received: by smtp23.relay.iad3b.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id E03C2A013B; Sun, 27 Apr 2025 15:20:30 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.1\)) Subject: Re: BUG #18905: The opposite WHERE clause intersects and is always an empty set. It should perform no action. From: Christophe Pettus X-Priority: 3 In-Reply-To: Date: Sun, 27 Apr 2025 12:19:59 -0700 Cc: "David G. Johnston" , "pgsql-bugs@lists.postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: <2D956CA2-F876-48BA-B12E-FB9FD81F4AE5@thebuild.com> References: <18905-f17e775841805cda@postgresql.org> To: =?utf-8?B?6LWW6ZSm6L6J?= X-Mailer: Apple Mail (2.3776.700.51.11.1) X-Classification-ID: 79d1b8ff-f15a-4b66-b477-b100fcbe38e6-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Apr 27, 2025, at 10:54, =E8=B5=96=E9=94=A6=E8=BE=89 = 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.=