pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: David Steele <david@pgmasters.net>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] postgres_fdw bug in 9.6
Date: Thu, 30 Nov 2017 21:55:51 +0900
Message-ID: <5A1FFFD7.6080904@lab.ntt.co.jp> (raw)
In-Reply-To: <27145.1511994722@sss.pgh.pa.us>
References: <CAMkU=1y2G8VOVBHv3iXU2TMAj7-RyBFFW1uhkr5sm9LQ2=X35g@mail.gmail.com>
	<22168.1504041271@sss.pgh.pa.us>
	<20170905044336.18925.22634.pgcf@coridan.postgresql.org>
	<07ed8f27-12cf-8403-d23b-f7d907de4a83@lab.ntt.co.jp>
	<CAFjFpRd7fuanj3s-bXpeuLhaRJnFuEWCiwu_-Q4Ox7wGCAW_Mw@mail.gmail.com>
	<7031.1507215420@sss.pgh.pa.us>
	<25877.1511886076@sss.pgh.pa.us>
	<CA+TgmoaUu=QTvfoCVfidXH=CU4_e1nWTMj=jTQpB3eoHYAVpzw@mail.gmail.com>
	<CAFjFpRc4f9u60t7VgTiw1quoto5gmXJ0tHMwCfSM5dx253B8fw@mail.gmail.com>
	<27145.1511994722@sss.pgh.pa.us>

(2017/11/30 7:32), Tom Lane wrote:
> AFAICT, [1] just demonstrates that nobody had thought about the scenario
> up to that point, not that the subsequently chosen solution was a good
> one.  In that example,
>
> LockRows  (cost=100.00..101.18 rows=4 width=70)
>     Output: tab.a, tab.b, tab.ctid, foo.*, bar.*
>     ->   Nested Loop  (cost=100.00..101.14 rows=4 width=70)
>           Output: tab.a, tab.b, tab.ctid, foo.*, bar.*
>           Join Filter: (foo.a = tab.a)
>           ->   Seq Scan on public.tab  (cost=0.00..1.01 rows=1 width=14)
>                 Output: tab.a, tab.b, tab.ctid
>           ->   Foreign Scan  (cost=100.00..100.08 rows=4 width=64)
>                 Output: foo.*, foo.a, bar.*, bar.a
>                 Relations: (public.foo) INNER JOIN (public.bar)
>                 Remote SQL: SELECT l.a1, l.a2, r.a1, r.a2 FROM (SELECT ROW(l.a9), l.a9 FROM (SELECT a a9 FROM public.foo FOR UPDATE) l) l (a1, a2) INNER JOIN (SELECT ROW(r.a9), r.a9 FROM (SELECT a a9 FROM public.bar FOR UPDATE) r) r (a1, a2) ON ((l.a2 = r.a2))
>
> 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?

Best regards,
Etsuro Fujita




view thread (128+ messages)  latest in thread

Message-ID: <5A1FFFD7.6080904@lab.ntt.co.jp>
Permalink:  ../5A1FFFD7.6080904@lab.ntt.co.jp/
Also on:    postgresql.org/message-id/5A1FFFD7.6080904@lab.ntt.co.jp

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: fujita.etsuro@lab.ntt.co.jp, tgl@sss.pgh.pa.us, ashutosh.bapat@enterprisedb.com, robertmhaas@gmail.com, jeff.janes@gmail.com, david@pgmasters.net
  Subject: Re: [HACKERS] postgres_fdw bug in 9.6
  In-Reply-To: <5A1FFFD7.6080904@lab.ntt.co.jp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox