Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBG5E-00040L-Dl for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Jul 2022 13:37:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oBG5D-0005aR-CO for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Jul 2022 13:37:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBG5D-0005Y0-3a for pgsql-hackers@lists.postgresql.org; Tue, 12 Jul 2022 13:37:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBG5A-0001PM-M4 for pgsql-hackers@lists.postgresql.org; Tue, 12 Jul 2022 13:37:46 +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 26CDbfOp1515101; Tue, 12 Jul 2022 09:37:41 -0400 From: Tom Lane To: Richard Guo cc: Pg Hackers , "Finnerty, Jim" Subject: Re: Making Vars outer-join aware In-reply-to: References: <830269.1656693747@sss.pgh.pa.us> <1903934.1657031040@sss.pgh.pa.us> <553080.1657481916@sss.pgh.pa.us> Comments: In-reply-to Richard Guo message dated "Tue, 12 Jul 2022 15:20:37 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1515099.1657633061.1@sss.pgh.pa.us> Date: Tue, 12 Jul 2022 09:37:41 -0400 Message-ID: <1515100.1657633061@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > Note that the evaluation of expression 'b.j + 1' now occurs below the > outer join. Is this something we need to be concerned about? It seems more formally correct to me, but perhaps somebody would complain about possibly-useless expression evals. We could likely re-complicate the logic that inserts PHVs during pullup so that it looks for Vars it can apply the nullingrels to. Maybe there's an opportunity to share code with flatten_join_alias_vars? regards, tom lane