mirror of
https://github.com/postgres/postgres.git
synced 2025-08-24 09:27:52 +03:00
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.
This commit is contained in:
@@ -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,
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user