diff options
author | Robert Haas <rhaas@postgresql.org> | 2018-04-02 10:51:50 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2018-04-02 10:51:50 -0400 |
commit | 7e0d64c7a57e28fbcf093b6da9310a38367c1d75 (patch) | |
tree | f77becf9abb0354f0a48c6f684d182eb0e2a13d2 /src/backend/optimizer/prep | |
parent | 0b11a674fb11cc1571326c861ecdd7773d9e587f (diff) | |
download | postgresql-7e0d64c7a57e28fbcf093b6da9310a38367c1d75.tar.gz |
postgres_fdw: Push down partition-wise aggregation.
Since commit 7012b132d07c2b4ea15b0b3cb1ea9f3278801d98, postgres_fdw
has been able to push down the toplevel aggregation operation to the
remote server. Commit e2f1eb0ee30d144628ab523432320f174a2c8966 made
it possible to break down the toplevel aggregation into one
aggregate per partition. This commit lets postgres_fdw push down
aggregation in that case just as it does at the top level.
In order to make this work, this commit adds an additional argument
to the GetForeignUpperPaths FDW API. A matching argument is added
to the signature for create_upper_paths_hook. Third-party code using
either of these will need to be updated.
Also adjust create_foreignscan_plan() so that it picks up the correct
set of relids in this case.
Jeevan Chalke, reviewed by Ashutosh Bapat and by me and with some
adjustments by me. The larger patch series of which this patch is a
part was also reviewed and tested by Antonin Houska, Rajkumar
Raghuwanshi, David Rowley, Dilip Kumar, Konstantin Knizhnik, Pascal
Legrand, and Rafia Sabih.
Discussion: http://postgr.es/m/CAM2+6=V64_xhstVHie0Rz=KPEQnLJMZt_e314P0jaT_oJ9MR8A@mail.gmail.com
Discussion: http://postgr.es/m/CAM2+6=XPWujjmj5zUaBTGDoB38CemwcPmjkRy0qOcsQj_V+2sQ@mail.gmail.com
Diffstat (limited to 'src/backend/optimizer/prep')
-rw-r--r-- | src/backend/optimizer/prep/prepunion.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/optimizer/prep/prepunion.c b/src/backend/optimizer/prep/prepunion.c index 6e510f9d94..5236ab378e 100644 --- a/src/backend/optimizer/prep/prepunion.c +++ b/src/backend/optimizer/prep/prepunion.c @@ -1032,7 +1032,7 @@ postprocess_setop_rel(PlannerInfo *root, RelOptInfo *rel) */ if (create_upper_paths_hook) (*create_upper_paths_hook) (root, UPPERREL_SETOP, - NULL, rel); + NULL, rel, NULL); /* Select cheapest path */ set_cheapest(rel); |