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 1pppbc-0007ki-Jm for pgsql-bugs@arkaria.postgresql.org; Fri, 21 Apr 2023 12:11:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pppbb-0007W6-I8 for pgsql-bugs@arkaria.postgresql.org; Fri, 21 Apr 2023 12:11:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pppbb-0007Vx-4k for pgsql-bugs@lists.postgresql.org; Fri, 21 Apr 2023 12:11:11 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1pppbW-0014Vx-Qm for pgsql-bugs@lists.postgresql.org; Fri, 21 Apr 2023 12:11:09 +0000 Received: from [192.168.28.53] (cyclops.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id 488C021CCBD4; Fri, 21 Apr 2023 15:11:05 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1682079065; bh=h643KbjS+Ft8lcDRP5qQIw8Bvj1856lDRgCf4d8oB/4=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=czdCg79Ct7ihFWHu21I4Bdl0/X0CJwLas3aFLxUBBDJhOnhd9aC/8gYZYIeIwOVdF KCermILLdGdH8jJucZtWbAm0uNJsrqlT5JJppXszDHTU5NWCRDxmqV/haud2UZTTH3 bJbJk2TL/TqQUD2b2z6v/VINB+Y1oZJY+fMAS6JsctFEnD+gcy1tLJyQxrhMjMpTuU uoBe+aglQXvv6B9GP/MlmhVikKCRxYqJ5DFzXcvw5Okf1PWu1ICgl+ozu2LOu6cL8f L5kAQbFfV47y3AzFcxmpPE7jtpQWuHilNi2WTxBw4X6evZmI9Jg34sYBEo5C/2B9wY s6Km4V2dKn5OQ== Message-ID: <29b06792-77f4-9aad-09a0-58e98399448d@postgrespro.ru> Date: Fri, 21 Apr 2023 17:11:04 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: Clause accidentally pushed down ( Possible bug in Making Vars outer-join aware) Content-Language: en-US To: Richard Guo Cc: Tom Lane , PostgreSQL mailing lists References: <0b819232-4b50-f245-1c7d-c8c61bf41827@postgrespro.ru> <402433.1677524538@sss.pgh.pa.us> <2663884e-769a-b298-55b0-014c5a1ee55c@postgrespro.ru> <524303.1677538463@sss.pgh.pa.us> <999171.1677611407@sss.pgh.pa.us> From: Andrey Lepikhov Organization: Postgres Professional In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/21/23 14:34, Richard Guo wrote: > > On Thu, Apr 20, 2023 at 1:06 PM Andrey Lepikhov > > wrote: > Are you worried about upper clauses who reference to C vars?  In the > second form when we've formed A/B join, which would have both outer > joins' relids in its relid set, the upper clause will be able to be > applied there, and it is the correct join level. Yes, of course. I thought about the case with INNER JOINs in between, something like that: a LEFT JOIN b ON b.x INNER JOIN c ON (b.x=c.x) LEFT JOIN d ON b.x ... But, it is still a doubt. > > BTW, cfbot reminds that a rebase is needed.  So re-attach the two > patches.  Now I think it should be in 'Needs review' again in CF.  I'll > go and do the change. Thanks! -- Regards Andrey Lepikhov Postgres Professional