postgresql/contrib/postgres_fdw
Robert Haas f49842d1ee Basic partition-wise join functionality.
Instead of joining two partitioned tables in their entirety we can, if
it is an equi-join on the partition keys, join the matching partitions
individually.  This involves teaching the planner about "other join"
rels, which are related to regular join rels in the same way that
other member rels are related to baserels.  This can use significantly
more CPU time and memory than regular join planning, because there may
now be a set of "other" rels not only for every base relation but also
for every join relation.  In most practical cases, this probably
shouldn't be a problem, because (1) it's probably unusual to join many
tables each with many partitions using the partition keys for all
joins and (2) if you do that scenario then you probably have a big
enough machine to handle the increased memory cost of planning and (3)
the resulting plan is highly likely to be better, so what you spend in
planning you'll make up on the execution side.  All the same, for now,
turn this feature off by default.

Currently, we can only perform joins between two tables whose
partitioning schemes are absolutely identical.  It would be nice to
cope with other scenarios, such as extra partitions on one side or the
other with no match on the other side, but that will have to wait for
a future patch.

Ashutosh Bapat, reviewed and tested by Rajkumar Raghuwanshi, Amit
Langote, Rafia Sabih, Thomas Munro, Dilip Kumar, Antonin Houska, Amit
Khandekar, and by me.  A few final adjustments by me.

Discussion: http://postgr.es/m/CAFjFpRfQ8GrQvzp3jA2wnLqrHmaXna-urjm_UY9BqXj=EaDTSA@mail.gmail.com
Discussion: http://postgr.es/m/CAFjFpRcitjfrULr5jfuKWRPsGUX0LQ0k8-yG0Qw2+1LBGNpMdw@mail.gmail.com
2017-10-06 11:11:10 -04:00
..
expected Basic partition-wise join functionality. 2017-10-06 11:11:10 -04:00
sql Basic partition-wise join functionality. 2017-10-06 11:11:10 -04:00
.gitignore
Makefile Allow postgres_fdw to ship extension funcs/operators for remote execution. 2015-11-03 18:42:18 -05:00
connection.c Re-establish postgres_fdw connections after server or user mapping changes. 2017-07-21 12:51:38 -04:00
deparse.c Change tupledesc->attrs[n] to TupleDescAttr(tupledesc, n). 2017-08-20 11:19:07 -07:00
option.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
postgres_fdw--1.0.sql
postgres_fdw.c Sync function prototype with its actual definition. 2017-09-06 17:52:08 -04:00
postgres_fdw.control
postgres_fdw.h postgres_fdw: Move function prototype to correct section. 2017-06-22 12:44:53 -04:00
shippable.c Update copyright via script for 2017 2017-01-03 13:48:53 -05:00