]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Allow FDWs and custom scan providers to replace joins with scans.
authorRobert Haas <rhaas@postgresql.org>
Fri, 1 May 2015 12:50:35 +0000 (08:50 -0400)
committerRobert Haas <rhaas@postgresql.org>
Fri, 1 May 2015 12:50:35 +0000 (08:50 -0400)
commite7cb7ee14555cc9c5773e2c102efd6371f6f2005
treefc1d7ab49a9f9eee6027a6ace17c37963e514cc9
parent2b22795b32576fa7173b501b646581a17de35902
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.
20 files changed:
doc/src/sgml/custom-scan.sgml
doc/src/sgml/fdwhandler.sgml
src/backend/commands/explain.c
src/backend/executor/execScan.c
src/backend/executor/nodeCustom.c
src/backend/executor/nodeForeignscan.c
src/backend/foreign/foreign.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/outfuncs.c
src/backend/optimizer/path/joinpath.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/setrefs.c
src/backend/optimizer/util/plancat.c
src/backend/optimizer/util/relnode.c
src/backend/utils/adt/ruleutils.c
src/include/foreign/fdwapi.h
src/include/nodes/plannodes.h
src/include/nodes/relation.h
src/include/optimizer/paths.h
src/include/optimizer/planmain.h