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 1oQxmG-0004wf-5a for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Aug 2022 21:19:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oQxmE-0005pY-1w for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Aug 2022 21:19:06 +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 1oQxmD-0005pP-PC for pgsql-hackers@lists.postgresql.org; Wed, 24 Aug 2022 21:19:05 +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 1oQxm7-0007vH-9j for pgsql-hackers@lists.postgresql.org; Wed, 24 Aug 2022 21:19:05 +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 27OLIrkF1165801; Wed, 24 Aug 2022 17:18:53 -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> <2741731.1660848346@sss.pgh.pa.us> <3839865.1661035931@sss.pgh.pa.us> Comments: In-reply-to Richard Guo message dated "Wed, 24 Aug 2022 18:26:46 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1165799.1661375933.1@sss.pgh.pa.us> Date: Wed, 24 Aug 2022 17:18:53 -0400 Message-ID: <1165800.1661375933@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > On Sun, Aug 21, 2022 at 6:52 AM Tom Lane wrote: >> What I'm thinking we should do about this, once we detect that >> this identity is applicable, is to generate *both* forms of Pbc, >> either adding or removing the varnullingrels bits depending on >> which form we got from the parser. > Do you mean we generate two RestrictInfos for Pbc in the case of > identity 3, one with varnullingrels and one without varnullingrels, and > choose the appropriate one when forming join paths? Right. > Do we need to also > generate two SpecialJoinInfos for the B/C join in the first order, with > and without the A/B join in its min_lefthand? No, the SpecialJoinInfos would stay as they are now. It's already the case that the first join's min_righthand would contain only B, and the second one's min_righthand would contain only C. regards, tom lane