Re: Optimization for updating foreign tables in Postgres FDW

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: Etsuro Fujita *EXTERN* <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, 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: 2014-09-11 15:30:49
Message-ID: 20140911153049.GC16422@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Albe Laurenz (laurenz(dot)albe(at)wien(dot)gv(dot)at) wrote:
> Etsuro Fujita wrote:
> > I agree with you on that point. So, I've updated the patch to have the
> > explicit flag, as you proposed. Attached is the updated version of the
> > patch. In this version, I've also revised code and its comments a bit.
>
> Thank you, I have set the patch to "Ready for Committer".

I had a few minutes, so I started looking at this patch and I definitely
like where it's going. One concern which was brought up that I didn't
see completely addressed was around UPDATE/DELETE with LIMIT, which
seems to be making progress towards getting in. Presumably, we'd simply
disallow this optimization in that case, but we'll need a way to
identify that case..

I have to admit that, while I applaud the effort made to have this
change only be to postgres_fdw, I'm not sure that having the
update/delete happening during the Scan phase and then essentially
no-op'ing the ExecForeignUpdate/ExecForeignDelete is entirely in-line
with the defined API.

I would have thought we'd add a capability check function that says "can
this Modify be completely pushed down" and then have a way for that to
happen in ExecForeignUpdate/ExecForeignDelete. That means changes to
the existing API, of course, and if people feel that's unnecessary then
I'd suggest that we need to at least document that we're willing to
support these bulk operations happening on the remote siude during the
pre-Modify Scan and not during the ExecForeignUpdate/ExecForeignDelete.

Thanks,

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-09-11 15:35:02 Re: Patch to support SEMI and ANTI join removal
Previous Message Tom Lane 2014-09-11 15:28:19 Re: bad estimation together with large work_mem generates terrible slow hash joins