pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: postgres_fdw: Push down UPDATE/DELETE joins to remote servers.
Date: Wed, 07 Feb 2018 20:39:31 +0000
Message-ID: <E1ejWV9-0001p7-2Q@gemulon.postgresql.org> (raw)

postgres_fdw: Push down UPDATE/DELETE joins to remote servers.

Commit 0bf3ae88af330496517722e391e7c975e6bad219 allowed direct
foreign table modification; instead of fetching each row, updating
it locally, and then pushing the modification back to the remote
side, we would instead do all the work on the remote server via a
single remote UPDATE or DELETE command.  However, that commit only
enabled this optimization when join tree consisted only of the
target table.

This change allows the same optimization when an UPDATE statement
has a FROM clause or a DELETE statement has a USING clause.  This
works much like ordinary foreign join pushdown, in that the tables
must be on the same remote server, relevant parts of the query
must be pushdown-safe, and so forth.

Etsuro Fujita, reviewed by Ashutosh Bapat, Rushabh Lathia, and me.
Some formatting corrections by me.

Discussion: http://postgr.es/m/5A57193A.2080003@lab.ntt.co.jp
Discussion: http://postgr.es/m/b9cee735-62f8-6c07-7528-6364ce9347d0@lab.ntt.co.jp

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1bc0100d270e5bcc980a0629b8726a32a497e788

Modified Files
--------------
contrib/postgres_fdw/deparse.c                 | 218 ++++++++++--
contrib/postgres_fdw/expected/postgres_fdw.out | 241 +++++++++++---
contrib/postgres_fdw/postgres_fdw.c            | 438 ++++++++++++++++++++++++-
contrib/postgres_fdw/postgres_fdw.h            |   2 +
contrib/postgres_fdw/sql/postgres_fdw.sql      |  56 +++-
5 files changed, 863 insertions(+), 92 deletions(-)



Message-ID: <E1ejWV9-0001p7-2Q@gemulon.postgresql.org>
Permalink:  ../E1ejWV9-0001p7-2Q@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ejWV9-0001p7-2Q@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org
  Subject: Re: pgsql: postgres_fdw: Push down UPDATE/DELETE joins to remote servers.
  In-Reply-To: <E1ejWV9-0001p7-2Q@gemulon.postgresql.org>
  References: <E1ejWV9-0001p7-2Q@gemulon.postgresql.org>

* 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