diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-03-05 16:15:59 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-03-05 16:15:59 -0500 |
commit | 6b289942bfdbbfa2955cedc591c522822a7ffbfe (patch) | |
tree | 6205261ee347d578153391cec4dbd99e55e1a6bd /src/backend/optimizer/plan/createplan.c | |
parent | 3f47e145f1869f147a807e5a2cb80d21a13e10ae (diff) |
Redesign PlanForeignScan API to allow multiple paths for a foreign table.
The original API specification only allowed an FDW to create a single
access path, which doesn't seem like a terribly good idea in hindsight.
Instead, move the responsibility for building the Path node and calling
add_path() into the FDW's PlanForeignScan function. Now, it can do that
more than once if appropriate. There is no longer any need for the
transient FdwPlan struct, so get rid of that.
Etsuro Fujita, Shigeru Hanada, Tom Lane
Diffstat (limited to 'src/backend/optimizer/plan/createplan.c')
-rw-r--r-- | src/backend/optimizer/plan/createplan.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index 9ac0c991902..b1df56cafd2 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -20,7 +20,6 @@ #include <math.h> #include "access/skey.h" -#include "foreign/fdwapi.h" #include "miscadmin.h" #include "nodes/makefuncs.h" #include "nodes/nodeFuncs.h" @@ -121,7 +120,7 @@ static CteScan *make_ctescan(List *qptlist, List *qpqual, static WorkTableScan *make_worktablescan(List *qptlist, List *qpqual, Index scanrelid, int wtParam); static ForeignScan *make_foreignscan(List *qptlist, List *qpqual, - Index scanrelid, bool fsSystemCol, FdwPlan *fdwplan); + Index scanrelid, bool fsSystemCol, List *fdw_private); static BitmapAnd *make_bitmap_and(List *bitmapplans); static BitmapOr *make_bitmap_or(List *bitmapplans); static NestLoop *make_nestloop(List *tlist, @@ -1847,7 +1846,7 @@ create_foreignscan_plan(PlannerInfo *root, ForeignPath *best_path, scan_clauses, scan_relid, fsSystemCol, - best_path->fdwplan); + best_path->fdw_private); copy_path_costsize(&scan_plan->scan.plan, &best_path->path); @@ -3189,7 +3188,7 @@ make_foreignscan(List *qptlist, List *qpqual, Index scanrelid, bool fsSystemCol, - FdwPlan *fdwplan) + List *fdw_private) { ForeignScan *node = makeNode(ForeignScan); Plan *plan = &node->scan.plan; @@ -3201,7 +3200,7 @@ make_foreignscan(List *qptlist, plan->righttree = NULL; node->scan.scanrelid = scanrelid; node->fsSystemCol = fsSystemCol; - node->fdwplan = fdwplan; + node->fdw_private = fdw_private; return node; } |