summaryrefslogtreecommitdiff
path: root/src/include/optimizer
diff options
context:
space:
mode:
authorTom Lane2014-11-21 19:05:46 +0000
committerTom Lane2014-11-21 19:05:46 +0000
commitc2ea2285e978d9289084846a3343cef7d261d880 (patch)
tree97546a6da2b2eaa1275d311a04810658724b5547 /src/include/optimizer
parent4077fb4d1d34ad04dfb95ba676c2b43ea1f1da53 (diff)
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.
Diffstat (limited to 'src/include/optimizer')
-rw-r--r--src/include/optimizer/pathnode.h9
-rw-r--r--src/include/optimizer/paths.h7
2 files changed, 7 insertions, 9 deletions
diff --git a/src/include/optimizer/pathnode.h b/src/include/optimizer/pathnode.h
index 0f2882986c0..26b17f5f7af 100644
--- a/src/include/optimizer/pathnode.h
+++ b/src/include/optimizer/pathnode.h
@@ -129,15 +129,6 @@ extern Path *reparameterize_path(PlannerInfo *root, Path *path,
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
*/
extern void setup_simple_rel_arrays(PlannerInfo *root);
diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h
index 9b22fda1ef4..afa5f9bcd0e 100644
--- a/src/include/optimizer/paths.h
+++ b/src/include/optimizer/paths.h
@@ -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,