1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-24 09:27:52 +03:00

Simplify API for initially hooking custom-path providers into the planner.

Instead of register_custom_path_provider and a CreateCustomScanPath
callback, let's just provide a standard function hook in set_rel_pathlist.
This is more flexible than what was previously committed, is more like the
usual conventions for planner hooks, and requires less support code in the
core.  We had discussed this design (including centralizing the
set_cheapest() calls) back in March or so, so I'm not sure why it wasn't
done like this already.
This commit is contained in:
Tom Lane
2014-11-21 14:05:46 -05:00
parent 4077fb4d1d
commit c2ea2285e9
5 changed files with 27 additions and 88 deletions

View File

@@ -128,15 +128,6 @@ extern Path *reparameterize_path(PlannerInfo *root, Path *path,
Relids required_outer,
double loop_count);
/*
* Interface definition of custom-scan providers
*/
extern void register_custom_path_provider(const CustomPathMethods *cpp_methods);
extern void create_customscan_paths(PlannerInfo *root,
RelOptInfo *baserel,
RangeTblEntry *rte);
/*
* prototypes for relnode.c
*/

View File

@@ -23,6 +23,13 @@
extern bool enable_geqo;
extern int geqo_threshold;
/* Hook for plugins to get control in set_rel_pathlist() */
typedef void (*set_rel_pathlist_hook_type) (PlannerInfo *root,
RelOptInfo *rel,
Index rti,
RangeTblEntry *rte);
extern PGDLLIMPORT set_rel_pathlist_hook_type set_rel_pathlist_hook;
/* Hook for plugins to replace standard_join_search() */
typedef RelOptInfo *(*join_search_hook_type) (PlannerInfo *root,
int levels_needed,