diff options
| author | Robert Haas | 2015-05-01 12:50:35 +0000 |
|---|---|---|
| committer | Robert Haas | 2015-05-01 12:50:35 +0000 |
| commit | e7cb7ee14555cc9c5773e2c102efd6371f6f2005 (patch) | |
| tree | fc1d7ab49a9f9eee6027a6ace17c37963e514cc9 /src/include/optimizer | |
| parent | 2b22795b32576fa7173b501b646581a17de35902 (diff) | |
Allow FDWs and custom scan providers to replace joins with scans.
Foreign data wrappers can use this capability for so-called "join
pushdown"; that is, instead of executing two separate foreign scans
and then joining the results locally, they can generate a path which
performs the join on the remote server and then is scanned locally.
This commit does not extend postgres_fdw to take advantage of this
capability; it just provides the infrastructure.
Custom scan providers can use this in a similar way. Previously,
it was only possible for a custom scan provider to scan a single
relation. Now, it can scan an entire join tree, provided of course
that it knows how to produce the same results that the join would
have produced if executed normally.
KaiGai Kohei, reviewed by Shigeru Hanada, Ashutosh Bapat, and me.
Diffstat (limited to 'src/include/optimizer')
| -rw-r--r-- | src/include/optimizer/paths.h | 13 | ||||
| -rw-r--r-- | src/include/optimizer/planmain.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h index 6cad92e4430..c42c69d7460 100644 --- a/src/include/optimizer/paths.h +++ b/src/include/optimizer/paths.h @@ -30,6 +30,19 @@ typedef void (*set_rel_pathlist_hook_type) (PlannerInfo *root, RangeTblEntry *rte); extern PGDLLIMPORT set_rel_pathlist_hook_type set_rel_pathlist_hook; +/* Hook for plugins to get control in add_paths_to_joinrel() */ +typedef void (*set_join_pathlist_hook_type) (PlannerInfo *root, + RelOptInfo *joinrel, + RelOptInfo *outerrel, + RelOptInfo *innerrel, + List *restrictlist, + JoinType jointype, + SpecialJoinInfo *sjinfo, + SemiAntiJoinFactors *semifactors, + Relids param_source_rels, + Relids extra_lateral_rels); +extern PGDLLIMPORT set_join_pathlist_hook_type set_join_pathlist_hook; + /* Hook for plugins to replace standard_join_search() */ typedef RelOptInfo *(*join_search_hook_type) (PlannerInfo *root, int levels_needed, diff --git a/src/include/optimizer/planmain.h b/src/include/optimizer/planmain.h index fa72918d1bb..0c8cbcded96 100644 --- a/src/include/optimizer/planmain.h +++ b/src/include/optimizer/planmain.h @@ -41,6 +41,7 @@ extern Plan *optimize_minmax_aggregates(PlannerInfo *root, List *tlist, * prototypes for plan/createplan.c */ extern Plan *create_plan(PlannerInfo *root, Path *best_path); +extern Plan *create_plan_recurse(PlannerInfo *root, Path *best_path); extern SubqueryScan *make_subqueryscan(List *qptlist, List *qpqual, Index scanrelid, Plan *subplan); extern ForeignScan *make_foreignscan(List *qptlist, List *qpqual, |
