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 1oOPU1-0001ip-LP for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Aug 2022 20:17:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oOPU0-0004jL-9s for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Aug 2022 20:17:44 +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 1oOPTz-0004jC-Vc for pgsql-hackers@lists.postgresql.org; Wed, 17 Aug 2022 20:17:43 +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 1oOPTx-00019m-QE for pgsql-hackers@lists.postgresql.org; Wed, 17 Aug 2022 20:17:43 +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 27HKHakb2060463; Wed, 17 Aug 2022 16:17:36 -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> <1515100.1657633061@sss.pgh.pa.us> <2217146.1657721363@sss.pgh.pa.us> <2055912.1659383493@sss.pgh.pa.us> <1188905.1660666103@sss.pgh.pa.us> <1405792.1660677844@sss.pgh.pa.us> <1538543.1660683428@sss.pgh.pa.us> Comments: In-reply-to Richard Guo message dated "Wed, 17 Aug 2022 17:25:53 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2060461.1660767456.1@sss.pgh.pa.us> Date: Wed, 17 Aug 2022 16:17:36 -0400 Message-ID: <2060462.1660767456@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > BTW, the comment just above the two calls to build_joinrel_tlist says: > * Create a new tlist containing just the vars that need to be output from > Here by 'vars' it means both plain Vars and PlaceHolderVars, right? If > not we may need to adjust this comment to also include PlaceHolderVars. I think it did intend just Vars because that's all that build_joinrel_tlist did; but we really should have updated it when we invented PlaceHolderVars, and even more so now that build_joinrel_tlist adds PHVs too. I changed the wording. > A minor comment is that seems we can get rid of phid inside > PlaceHolderInfo, since we do not do linear list searches any more. It's > some duplicate to the phid inside PlaceHolderVar. Currently there are > two places referencing PlaceHolderInfo->phid, remove_rel_from_query and > find_placeholder_info. We can use PlaceHolderVar->phid instead in both > the two places. Meh, I'm not excited about that. I don't think that the phid field is only there to make the search loops faster; it's the basic identity of the PlaceHolderInfo. regards, tom lane