Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNF82-00030A-8j for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Dec 2017 09:39:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNF81-0004SI-Hk for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Dec 2017 09:39:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eNF81-0004S8-BC for pgsql-hackers@lists.postgresql.org; Fri, 08 Dec 2017 09:39:33 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eNF7y-0004zp-Fj for pgsql-hackers@postgresql.org; Fri, 08 Dec 2017 09:39:32 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id vB89dNxI009291; Fri, 8 Dec 2017 18:39:23 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id F1E1560293; Fri, 8 Dec 2017 18:39:22 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id E26E860283; Fri, 8 Dec 2017 18:39:22 +0900 (JST) Received: from [IPv6:::1] (unknown [129.60.241.75]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id D8002400364; Fri, 8 Dec 2017 18:39:22 +0900 (JST) Message-ID: <5A2A5E10.1040604@lab.ntt.co.jp> Date: Fri, 08 Dec 2017 18:40:32 +0900 From: Etsuro Fujita User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 Subject: Re: [HACKERS] postgres_fdw bug in 9.6 References: <22168.1504041271@sss.pgh.pa.us> <20170905044336.18925.22634.pgcf@coridan.postgresql.org> <07ed8f27-12cf-8403-d23b-f7d907de4a83@lab.ntt.co.jp> <7031.1507215420@sss.pgh.pa.us> <25877.1511886076@sss.pgh.pa.us> <27145.1511994722@sss.pgh.pa.us> <5A1FFFD7.6080904@lab.ntt.co.jp> <85224.1512051763@sss.pgh.pa.us> In-Reply-To: <85224.1512051763@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: Tom Lane Cc: Ashutosh Bapat , Robert Haas , Jeff Janes , David Steele , pgsql-hackers X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk (2017/11/30 23:22), Tom Lane wrote: > Etsuro Fujita writes: >> (2017/11/30 7:32), Tom Lane wrote: >>> the output of the foreign join cannot change during EPQ, since the remote >>> server already locked the rows before returning them. The only thing that >>> can change is the output of the local scan on public.tab. Yes, we then >>> need to re-verify that foo.a = tab.a ... but in this example, that's the >>> responsibility of the NestLoop plan node, not the foreign join. > >> That's right, but is that true when the FDW uses late row locking? > > An FDW using late row locking would need to work harder, yes. But > that's true at the scan level as well as the join level. We have > already committed to using early locking in postgres_fdw, for the > network-round-trip-cost reasons I mentioned before, and I can't see > why we'd change that decision at the join level. My concern is FDWs that support join pushdown in combination with late row locking. I don't know whether such FDWs really exist, but if so, an output of a foreign join computed from re-fetched tuples might change. > Right now we've got the worst of both worlds, in that we're actually > doing early row locking on the remote, but we're paying (some of) the > code complexity costs required for late locking. Because we have provided the late row locking API, I think we should pay a certain degree of consideration for such FDWs. Best regards, Etsuro Fujita