Re: Optimization for updating foreign tables in Postgres FDW

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Shigeru Hanada <shigeru(dot)hanada(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Optimization for updating foreign tables in Postgres FDW
Date: 2015-04-17 03:35:44
Message-ID: 55307F90.7080405@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015/04/17 10:23, Amit Langote wrote:
> By the way, one suggestion may be to attach a "(pushed down)" to the
> ModifyTable's "Foreign Update". And in that case, there would be no mention of
> corresponding scan node in the list below exactly because there would be none.
>
> postgres=# explain verbose update parent set c1 = c1;
> QUERY PLAN
> ------------------------------------------------------------------------------
> Update on public.parent (cost=0.00..364.54 rows=4819 width=10)
> Update on public.parent
> Foreign Update (pushed down) on public.ft1
> Foreign Update (pushed down) on public.ft2
> -> Seq Scan on public.parent (cost=0.00..0.00 rows=1 width=10)
> Output: parent.c1, parent.ctid

Thanks for the suggestion!

I'm not sure that that is a good idea because (1) that is contrary to
the reality (the update pushdown patch lets the ForeignScan nodes do
UPDATE/DELETE RETURNING and then do nothing at ModifyTable!) and because
(2) that might cause the problem of associating subplans' update
information with subplans' scan information, pointed out by Tom [1].

Best regards,
Etsuro Fujita

[1] http://www.postgresql.org/message-id/22505.1426986174@sss.pgh.pa.us

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2015-04-17 04:16:15 Re: Optimization for updating foreign tables in Postgres FDW
Previous Message Tatsuo Ishii 2015-04-17 03:15:48 Re: reparsing query