postgres_fdw: Push down aggregates to remote servers

Enterprise / PostgreSQL - Robert Haas [postgresql.org] - 21 October 2016 08:54 UTC

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.

7012b13 postgres_fdw: Push down aggregates to remote servers.
contrib/postgres_fdw/deparse.c | 568 +++++++++--
contrib/postgres_fdw/expected/postgres_fdw.out | 1219 +++++++++++++++++++++++-
contrib/postgres_fdw/postgres_fdw.c | 494 +++++++++-
contrib/postgres_fdw/postgres_fdw.h | 5 +-
contrib/postgres_fdw/sql/postgres_fdw.sql | 305 ++++++
src/backend/optimizer/plan/createplan.c | 11 +-
6 files changed, 2452 insertions(+), 150 deletions(-)

Upstream: git.postgresql.org


  • Share