diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/foreign/fdwapi.h | 35 | ||||
| -rw-r--r-- | src/include/nodes/nodes.h | 1 | ||||
| -rw-r--r-- | src/include/nodes/plannodes.h | 3 | ||||
| -rw-r--r-- | src/include/nodes/relation.h | 10 | ||||
| -rw-r--r-- | src/include/optimizer/pathnode.h | 6 |
5 files changed, 17 insertions, 38 deletions
diff --git a/src/include/foreign/fdwapi.h b/src/include/foreign/fdwapi.h index 3696623742..9e135c6206 100644 --- a/src/include/foreign/fdwapi.h +++ b/src/include/foreign/fdwapi.h @@ -20,41 +20,12 @@ struct ExplainState; /* - * FdwPlan is the information returned to the planner by PlanForeignScan. - */ -typedef struct FdwPlan -{ - NodeTag type; - - /* - * Cost estimation info. The startup_cost is time before retrieving the - * first row, so it should include costs of connecting to the remote host, - * sending over the query, etc. Note that PlanForeignScan also ought to - * set baserel->rows and baserel->width if it can produce any usable - * estimates of those values. - */ - Cost startup_cost; /* cost expended before fetching any tuples */ - Cost total_cost; /* total cost (assuming all tuples fetched) */ - - /* - * FDW private data, which will be available at execution time. - * - * Note that everything in this list must be copiable by copyObject(). One - * way to store an arbitrary blob of bytes is to represent it as a bytea - * Const. Usually, though, you'll be better off choosing a representation - * that can be dumped usefully by nodeToString(). - */ - List *fdw_private; -} FdwPlan; - - -/* * Callback function signatures --- see fdwhandler.sgml for more info. */ -typedef FdwPlan *(*PlanForeignScan_function) (Oid foreigntableid, - PlannerInfo *root, - RelOptInfo *baserel); +typedef void (*PlanForeignScan_function) (Oid foreigntableid, + PlannerInfo *root, + RelOptInfo *baserel); typedef void (*ExplainForeignScan_function) (ForeignScanState *node, struct ExplainState *es); diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index 0e7d184a0d..905458fd50 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -62,7 +62,6 @@ typedef enum NodeTag T_CteScan, T_WorkTableScan, T_ForeignScan, - T_FdwPlan, T_Join, T_NestLoop, T_MergeJoin, diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h index 7d90b91ad5..3962792d3d 100644 --- a/src/include/nodes/plannodes.h +++ b/src/include/nodes/plannodes.h @@ -468,8 +468,7 @@ typedef struct ForeignScan { Scan scan; bool fsSystemCol; /* true if any "system column" is needed */ - /* use struct pointer to avoid including fdwapi.h here */ - struct FdwPlan *fdwplan; + List *fdw_private; /* private data for FDW */ } ForeignScan; diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h index 6ba920a479..2a68608005 100644 --- a/src/include/nodes/relation.h +++ b/src/include/nodes/relation.h @@ -794,12 +794,18 @@ typedef struct TidPath /* * ForeignPath represents a scan of a foreign table + * + * fdw_private contains FDW private data about the scan, which will be copied + * to the final ForeignScan plan node so that it is available at execution + * time. Note that everything in this list must be copiable by copyObject(). + * One way to store an arbitrary blob of bytes is to represent it as a bytea + * Const. Usually, though, you'll be better off choosing a representation + * that can be dumped usefully by nodeToString(). */ typedef struct ForeignPath { Path path; - /* use struct pointer to avoid including fdwapi.h here */ - struct FdwPlan *fdwplan; + List *fdw_private; } ForeignPath; /* diff --git a/src/include/optimizer/pathnode.h b/src/include/optimizer/pathnode.h index 1cf34171f4..3f80ca3fe9 100644 --- a/src/include/optimizer/pathnode.h +++ b/src/include/optimizer/pathnode.h @@ -68,7 +68,11 @@ extern Path *create_functionscan_path(PlannerInfo *root, RelOptInfo *rel); extern Path *create_valuesscan_path(PlannerInfo *root, RelOptInfo *rel); extern Path *create_ctescan_path(PlannerInfo *root, RelOptInfo *rel); extern Path *create_worktablescan_path(PlannerInfo *root, RelOptInfo *rel); -extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel); +extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel, + double rows, Cost startup_cost, Cost total_cost, + List *pathkeys, + Relids required_outer, List *param_clauses, + List *fdw_private); extern Relids calc_nestloop_required_outer(Path *outer_path, Path *inner_path); extern Relids calc_non_nestloop_required_outer(Path *outer_path, Path *inner_path); |
