summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/geqo/geqo_eval.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-06-09 04:19:00 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-06-09 04:19:00 +0000
commita31ad27fc5dc32a1453233575b3cf7b5c34cf515 (patch)
tree6bff6baa96ebe794165a4939d234f3a54068e2c6 /src/backend/optimizer/geqo/geqo_eval.c
parentc51815afed2bfac02fbc4afff891eb1224eb7eae (diff)
Simplify the planner's join clause management by storing join clauses
of a relation in a flat 'joininfo' list. The former arrangement grouped the join clauses according to the set of unjoined relids used in each; however, profiling on test cases involving lots of joins proves that that data structure is a net loss. It takes more time to group the join clauses together than is saved by avoiding duplicate tests later. It doesn't help any that there are usually not more than one or two clauses per group ...
Diffstat (limited to 'src/backend/optimizer/geqo/geqo_eval.c')
-rw-r--r--src/backend/optimizer/geqo/geqo_eval.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/backend/optimizer/geqo/geqo_eval.c b/src/backend/optimizer/geqo/geqo_eval.c
index 5d31ac738e7..d1bb3059fc0 100644
--- a/src/backend/optimizer/geqo/geqo_eval.c
+++ b/src/backend/optimizer/geqo/geqo_eval.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/optimizer/geqo/geqo_eval.c,v 1.75 2005/06/08 23:02:04 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/geqo/geqo_eval.c,v 1.76 2005/06/09 04:18:59 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -26,6 +26,7 @@
#include <math.h>
#include "optimizer/geqo.h"
+#include "optimizer/joininfo.h"
#include "optimizer/pathnode.h"
#include "optimizer/paths.h"
#include "utils/memutils.h"
@@ -261,13 +262,8 @@ desirable_join(PlannerInfo *root,
/*
* Join if there is an applicable join clause.
*/
- foreach(l, outer_rel->joininfo)
- {
- JoinInfo *joininfo = (JoinInfo *) lfirst(l);
-
- if (bms_is_subset(joininfo->unjoined_relids, inner_rel->relids))
- return true;
- }
+ if (have_relevant_joinclause(outer_rel, inner_rel))
+ return true;
/*
* Join if the rels are members of the same IN sub-select. This is