summaryrefslogtreecommitdiff
path: root/src/include/optimizer
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-09-26 18:51:51 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-09-26 18:51:51 +0000
commitcdf0231c88bd65409f93904443ee4c021f021c64 (patch)
tree972207b1e2775306cabffcf0fdaf8dc2ee81e789 /src/include/optimizer
parent149af068ff5e468961c6f400b636b40f7dc3ab9f (diff)
Create a function variable "join_search_hook" to let plugins override the
join search order portion of the planner; this is specifically intended to simplify developing a replacement for GEQO planning. Patch by Julius Stroffek, editorialized on by me. I renamed make_one_rel_by_joins to standard_join_search and make_rels_by_joins to join_search_one_level to better reflect their place within this scheme.
Diffstat (limited to 'src/include/optimizer')
-rw-r--r--src/include/optimizer/paths.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h
index 7199a545b29..cbde0c7b9a5 100644
--- a/src/include/optimizer/paths.h
+++ b/src/include/optimizer/paths.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/optimizer/paths.h,v 1.98 2007/05/22 01:40:33 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/optimizer/paths.h,v 1.99 2007/09/26 18:51:51 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -23,7 +23,16 @@
extern bool enable_geqo;
extern int geqo_threshold;
+/* Hook for plugins to replace standard_join_search() */
+typedef RelOptInfo * (*join_search_hook_type) (PlannerInfo *root,
+ int levels_needed,
+ List *initial_rels);
+extern PGDLLIMPORT join_search_hook_type join_search_hook;
+
+
extern RelOptInfo *make_one_rel(PlannerInfo *root, List *joinlist);
+extern RelOptInfo *standard_join_search(PlannerInfo *root, int levels_needed,
+ List *initial_rels);
#ifdef OPTIMIZER_DEBUG
extern void debug_print_rel(PlannerInfo *root, RelOptInfo *rel);
@@ -89,7 +98,8 @@ extern void add_paths_to_joinrel(PlannerInfo *root, RelOptInfo *joinrel,
* joinrels.c
* routines to determine which relations to join
*/
-extern List *make_rels_by_joins(PlannerInfo *root, int level, List **joinrels);
+extern List *join_search_one_level(PlannerInfo *root, int level,
+ List **joinrels);
extern RelOptInfo *make_join_rel(PlannerInfo *root,
RelOptInfo *rel1, RelOptInfo *rel2);
extern bool have_join_order_restriction(PlannerInfo *root,