summaryrefslogtreecommitdiff
path: root/src/include/foreign
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-03-05 16:15:59 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2012-03-05 16:15:59 -0500
commit6b289942bfdbbfa2955cedc591c522822a7ffbfe (patch)
tree6205261ee347d578153391cec4dbd99e55e1a6bd /src/include/foreign
parent3f47e145f1869f147a807e5a2cb80d21a13e10ae (diff)
downloadpostgresql-6b289942bfdbbfa2955cedc591c522822a7ffbfe.tar.gz
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/include/foreign')
-rw-r--r--src/include/foreign/fdwapi.h35
1 files changed, 3 insertions, 32 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);