From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Allow FDWs and custom scan providers to replace joins with scans
Date: Fri, 01 May 2015 12:59:01 +0000
Message-ID: <E1YoAWz-0001XG-Nk@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Allow FDWs and custom scan providers to replace joins with scans.
Foreign data wrappers can use this capability for so-called "join
pushdown"; that is, instead of executing two separate foreign scans
and then joining the results locally, they can generate a path which
performs the join on the remote server and then is scanned locally.
This commit does not extend postgres_fdw to take advantage of this
capability; it just provides the infrastructure.
Custom scan providers can use this in a similar way. Previously,
it was only possible for a custom scan provider to scan a single
relation. Now, it can scan an entire join tree, provided of course
that it knows how to produce the same results that the join would
have produced if executed normally.
KaiGai Kohei, reviewed by Shigeru Hanada, Ashutosh Bapat, and me.
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/e7cb7ee14555cc9c5773e2c102efd6371f6f2005
Modified Files
--------------
doc/src/sgml/custom-scan.sgml | 40 +++++++++
doc/src/sgml/fdwhandler.sgml | 36 ++++++++
src/backend/commands/explain.c | 15 +++-
src/backend/executor/execScan.c | 6 ++
src/backend/executor/nodeCustom.c | 34 +++++---
src/backend/executor/nodeForeignscan.c | 31 ++++---
src/backend/foreign/foreign.c | 21 +++--
src/backend/nodes/copyfuncs.c | 5 ++
src/backend/nodes/outfuncs.c | 5 ++
src/backend/optimizer/path/joinpath.c | 24 +++++
src/backend/optimizer/plan/createplan.c | 83 ++++++++++++++----
src/backend/optimizer/plan/setrefs.c | 145 ++++++++++++++++++++++++++-----
src/backend/optimizer/util/plancat.c | 7 +-
src/backend/optimizer/util/relnode.c | 14 +++
src/backend/utils/adt/ruleutils.c | 4 +
src/include/foreign/fdwapi.h | 15 ++++
src/include/nodes/plannodes.h | 20 +++--
src/include/nodes/relation.h | 2 +
src/include/optimizer/paths.h | 13 +++
src/include/optimizer/planmain.h | 1 +
20 files changed, 449 insertions(+), 72 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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: Allow FDWs and custom scan providers to replace joins with scans
In-Reply-To: <E1YoAWz-0001XG-Nk@gemulon.postgresql.org>
References: <E1YoAWz-0001XG-Nk@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