summaryrefslogtreecommitdiff
path: root/src/include/optimizer
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-11-28 00:46:19 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-11-28 00:46:19 +0000
commit1a95f12702b4e535b5e26ed9c3fcd0b2a1b1a20f (patch)
treec56c54fce5968c874b21fb902c1090b486da4719 /src/include/optimizer
parentfe83b975b2bdfa9b553872aa9a5dc959ca89a51f (diff)
downloadpostgresql-1a95f12702b4e535b5e26ed9c3fcd0b2a1b1a20f.tar.gz
Eliminate a lot of list-management overhead within join_search_one_level
by adding a requirement that build_join_rel add new join RelOptInfos to the appropriate list immediately at creation. Per report from Robert Haas, the list_concat_unique_ptr() calls that this change eliminates were taking the lion's share of the runtime in larger join problems. This doesn't do anything to fix the fundamental combinatorial explosion in large join problems, but it should push out the threshold of pain a bit further. Note: because this changes the order in which joinrel lists are built, it might result in changes in selected plans in cases where different alternatives have exactly the same costs. There is one example in the regression tests.
Diffstat (limited to 'src/include/optimizer')
-rw-r--r--src/include/optimizer/paths.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h
index d9e91675f2..4d04406d85 100644
--- a/src/include/optimizer/paths.h
+++ b/src/include/optimizer/paths.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/optimizer/paths.h,v 1.108 2009/09/17 20:49:29 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/optimizer/paths.h,v 1.109 2009/11/28 00:46:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -99,8 +99,7 @@ extern void add_paths_to_joinrel(PlannerInfo *root, RelOptInfo *joinrel,
* joinrels.c
* routines to determine which relations to join
*/
-extern List *join_search_one_level(PlannerInfo *root, int level,
- List **joinrels);
+extern void join_search_one_level(PlannerInfo *root, int level);
extern RelOptInfo *make_join_rel(PlannerInfo *root,
RelOptInfo *rel1, RelOptInfo *rel2);
extern bool have_join_order_restriction(PlannerInfo *root,