diff options
Diffstat (limited to 'src/backend/optimizer/geqo/geqo_eval.c')
-rw-r--r-- | src/backend/optimizer/geqo/geqo_eval.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/src/backend/optimizer/geqo/geqo_eval.c b/src/backend/optimizer/geqo/geqo_eval.c index 555ae296092..9b7fd2848bd 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.77.2.1 2005/11/22 18:23:10 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/geqo/geqo_eval.c,v 1.77.2.2 2007/02/16 00:14:16 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -254,28 +254,14 @@ static bool desirable_join(PlannerInfo *root, RelOptInfo *outer_rel, RelOptInfo *inner_rel) { - ListCell *l; - /* - * Join if there is an applicable join clause. + * Join if there is an applicable join clause, or if there is a join + * order restriction forcing these rels to be joined. */ - if (have_relevant_joinclause(outer_rel, inner_rel)) + if (have_relevant_joinclause(outer_rel, inner_rel) || + have_join_order_restriction(root, outer_rel, inner_rel)) return true; - /* - * Join if the rels are members of the same IN sub-select. This is needed - * to improve the odds that we will find a valid solution in a case where - * an IN sub-select has a clauseless join. - */ - foreach(l, root->in_info_list) - { - InClauseInfo *ininfo = (InClauseInfo *) lfirst(l); - - if (bms_is_subset(outer_rel->relids, ininfo->righthand) && - bms_is_subset(inner_rel->relids, ininfo->righthand)) - return true; - } - /* Otherwise postpone the join till later. */ return false; } |