diff options
Diffstat (limited to 'src/backend/optimizer/geqo')
-rw-r--r-- | src/backend/optimizer/geqo/geqo_eval.c | 59 | ||||
-rw-r--r-- | src/backend/optimizer/geqo/geqo_main.c | 6 | ||||
-rw-r--r-- | src/backend/optimizer/geqo/geqo_pool.c | 7 | ||||
-rw-r--r-- | src/backend/optimizer/geqo/geqo_recombination.c | 8 |
4 files changed, 41 insertions, 39 deletions
diff --git a/src/backend/optimizer/geqo/geqo_eval.c b/src/backend/optimizer/geqo/geqo_eval.c index ae849f5f00a..90aa34fa591 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-2004, 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.70 2004/08/29 04:12:33 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/geqo/geqo_eval.c,v 1.71 2004/08/29 05:06:43 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -32,7 +32,7 @@ static bool desirable_join(Query *root, - RelOptInfo *outer_rel, RelOptInfo *inner_rel); + RelOptInfo *outer_rel, RelOptInfo *inner_rel); /* @@ -56,8 +56,8 @@ geqo_eval(Gene *tour, int num_gene, GeqoEvalData *evaldata) * redundant cost calculations, we simply reject tours where tour[0] > * tour[1], assigning them an artificially bad fitness. * - * init_tour() is aware of this rule and so we should never reject a - * tour during the initial filling of the pool. It seems difficult to + * init_tour() is aware of this rule and so we should never reject a tour + * during the initial filling of the pool. It seems difficult to * persuade the recombination logic never to break the rule, however. */ if (num_gene >= 2 && tour[0] > tour[1]) @@ -151,23 +151,24 @@ gimme_tree(Gene *tour, int num_gene, GeqoEvalData *evaldata) /* * Push each relation onto the stack in the specified order. After * pushing each relation, see whether the top two stack entries are - * joinable according to the desirable_join() heuristics. If so, - * join them into one stack entry, and try again to combine with the - * next stack entry down (if any). When the stack top is no longer - * joinable, continue to the next input relation. After we have pushed - * the last input relation, the heuristics are disabled and we force - * joining all the remaining stack entries. + * joinable according to the desirable_join() heuristics. If so, join + * them into one stack entry, and try again to combine with the next + * stack entry down (if any). When the stack top is no longer + * joinable, continue to the next input relation. After we have + * pushed the last input relation, the heuristics are disabled and we + * force joining all the remaining stack entries. * * If desirable_join() always returns true, this produces a straight - * left-to-right join just like the old code. Otherwise we may produce - * a bushy plan or a left/right-sided plan that really corresponds to - * some tour other than the one given. To the extent that the heuristics - * are helpful, however, this will be a better plan than the raw tour. + * left-to-right join just like the old code. Otherwise we may + * produce a bushy plan or a left/right-sided plan that really + * corresponds to some tour other than the one given. To the extent + * that the heuristics are helpful, however, this will be a better + * plan than the raw tour. * - * Also, when a join attempt fails (because of IN-clause constraints), - * we may be able to recover and produce a workable plan, where the old - * code just had to give up. This case acts the same as a false result - * from desirable_join(). + * Also, when a join attempt fails (because of IN-clause constraints), we + * may be able to recover and produce a workable plan, where the old + * code just had to give up. This case acts the same as a false + * result from desirable_join(). */ for (rel_count = 0; rel_count < num_gene; rel_count++) { @@ -189,20 +190,20 @@ gimme_tree(Gene *tour, int num_gene, GeqoEvalData *evaldata) RelOptInfo *inner_rel = stack[stack_depth - 1]; /* - * Don't pop if heuristics say not to join now. However, - * once we have exhausted the input, the heuristics can't - * prevent popping. + * Don't pop if heuristics say not to join now. However, once + * we have exhausted the input, the heuristics can't prevent + * popping. */ if (rel_count < num_gene - 1 && !desirable_join(evaldata->root, outer_rel, inner_rel)) break; /* - * Construct a RelOptInfo representing the join of these - * two input relations. These are always inner joins. - * Note that we expect the joinrel not to exist in - * root->join_rel_list yet, and so the paths constructed for it - * will only include the ones we want. + * Construct a RelOptInfo representing the join of these two + * input relations. These are always inner joins. Note that + * we expect the joinrel not to exist in root->join_rel_list + * yet, and so the paths constructed for it will only include + * the ones we want. */ joinrel = make_join_rel(evaldata->root, outer_rel, inner_rel, JOIN_INNER); @@ -252,9 +253,9 @@ desirable_join(Query *root, } /* - * 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. + * 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) { diff --git a/src/backend/optimizer/geqo/geqo_main.c b/src/backend/optimizer/geqo/geqo_main.c index ccfe07d070d..bc95a1900e4 100644 --- a/src/backend/optimizer/geqo/geqo_main.c +++ b/src/backend/optimizer/geqo/geqo_main.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/optimizer/geqo/geqo_main.c,v 1.46 2004/08/29 04:12:33 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/geqo/geqo_main.c,v 1.47 2004/08/29 05:06:43 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -310,11 +310,11 @@ gimme_pool_size(int nr_rel) size = pow(2.0, nr_rel + 1.0); - maxsize = 50 * Geqo_effort; /* 50 to 500 individuals */ + maxsize = 50 * Geqo_effort; /* 50 to 500 individuals */ if (size > maxsize) return maxsize; - minsize = 10 * Geqo_effort; /* 10 to 100 individuals */ + minsize = 10 * Geqo_effort; /* 10 to 100 individuals */ if (size < minsize) return minsize; diff --git a/src/backend/optimizer/geqo/geqo_pool.c b/src/backend/optimizer/geqo/geqo_pool.c index e61a2e56a32..9b42b874783 100644 --- a/src/backend/optimizer/geqo/geqo_pool.c +++ b/src/backend/optimizer/geqo/geqo_pool.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/optimizer/geqo/geqo_pool.c,v 1.24 2004/08/29 04:12:33 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/geqo/geqo_pool.c,v 1.25 2004/08/29 05:06:43 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -96,8 +96,9 @@ random_init_pool(Pool *pool, GeqoEvalData *evaldata) int bad = 0; /* - * We immediately discard any invalid individuals (those that geqo_eval - * returns DBL_MAX for), thereby not wasting pool space on them. + * We immediately discard any invalid individuals (those that + * geqo_eval returns DBL_MAX for), thereby not wasting pool space on + * them. * * If we fail to make any valid individuals after 10000 tries, give up; * this probably means something is broken, and we shouldn't just let diff --git a/src/backend/optimizer/geqo/geqo_recombination.c b/src/backend/optimizer/geqo/geqo_recombination.c index f018902bed7..d2ebee17653 100644 --- a/src/backend/optimizer/geqo/geqo_recombination.c +++ b/src/backend/optimizer/geqo/geqo_recombination.c @@ -3,7 +3,7 @@ * geqo_recombination.c * misc recombination procedures * -* $PostgreSQL: pgsql/src/backend/optimizer/geqo/geqo_recombination.c,v 1.13 2004/01/23 23:54:21 tgl Exp $ +* $PostgreSQL: pgsql/src/backend/optimizer/geqo/geqo_recombination.c,v 1.14 2004/08/29 05:06:43 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -62,12 +62,12 @@ init_tour(Gene *tour, int num_gene) } /* - * Since geqo_eval() will reject tours where tour[0] > tour[1], - * we may as well switch the two to make it a valid tour. + * Since geqo_eval() will reject tours where tour[0] > tour[1], we may + * as well switch the two to make it a valid tour. */ if (num_gene >= 2 && tour[0] > tour[1]) { - Gene gtmp = tour[0]; + Gene gtmp = tour[0]; tour[0] = tour[1]; tour[1] = gtmp; |