postgres_fdw: Push down aggregates to remote servers.
authorRobert Haas <rhaas@postgresql.org>
Fri, 21 Oct 2016 13:54:29 +0000 (09:54 -0400)
committerRobert Haas <rhaas@postgresql.org>
Fri, 21 Oct 2016 13:54:29 +0000 (09:54 -0400)
commit7012b132d07c2b4ea15b0b3cb1ea9f3278801d98
treed0a15aedea339d5b74ec63768ff5b2db0abd0c2d
parent709e461befa8a4999c4ccdbfc7260ef8092e805c
postgres_fdw: Push down aggregates to remote servers.

Now that the upper planner uses paths, and now that we have proper hooks
to inject paths into the upper planning process, it's possible for
foreign data wrappers to arrange to push aggregates to the remote side
instead of fetching all of the rows and aggregating them locally.  This
figures to be a massive win for performance, so teach postgres_fdw to
do it.

Jeevan Chalke and Ashutosh Bapat.  Reviewed by Ashutosh Bapat with
additional testing by Prabhat Sahu.  Various mostly cosmetic changes
by me.
contrib/postgres_fdw/deparse.c
contrib/postgres_fdw/expected/postgres_fdw.out
contrib/postgres_fdw/postgres_fdw.c
contrib/postgres_fdw/postgres_fdw.h
contrib/postgres_fdw/sql/postgres_fdw.sql
src/backend/optimizer/plan/createplan.c