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 1r6Fdi-000Bf7-6p for pgsql-general@arkaria.postgresql.org; Thu, 23 Nov 2023 19:45:30 +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 1r6Fdg-0042Ge-Ah for pgsql-general@arkaria.postgresql.org; Thu, 23 Nov 2023 19:45:28 +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 1r6Fdf-0042GV-W4 for pgsql-general@lists.postgresql.org; Thu, 23 Nov 2023 19:45:27 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r6Fdd-0087j1-Eu for pgsql-general@lists.postgresql.org; Thu, 23 Nov 2023 19:45:27 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 3ANJjNKv3170787; Thu, 23 Nov 2023 14:45:23 -0500 From: Tom Lane To: Ron Johnson cc: "pgsql-generallists.postgresql.org" Subject: Re: Odd Shortcut behaviour in PG14 In-reply-to: References: Comments: In-reply-to Ron Johnson message dated "Thu, 23 Nov 2023 14:32:13 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3170785.1700768723.1@sss.pgh.pa.us> Date: Thu, 23 Nov 2023 14:45:23 -0500 Message-ID: <3170786.1700768723@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ron Johnson writes: > Out of curiosity, what is the point of adding the "true" predicate no > matter the position? Maybe I've created an incorrect truth table, but > "true AND" (and "AND true") don't make any logical difference when added > to (ekey > 0)*.* Not only does it not make any logical difference, but it shouldn't make any practical difference either, because the useless "true" subclause will be thrown away very early in planning, before any decisions would be taken on the strength of what is in the ON clause. So I was skeptical that the details presented were even correct. I think whatever is causing the behavioral change is something else that the OP hasn't identified/controlled for. Hard to tell with such fragmentary details. regards, tom lane