1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +03:00

Another round of planner/optimizer work. This is just restructuring and

code cleanup; no major improvements yet.  However, EXPLAIN does produce
more intuitive outputs for nested loops with indexscans now...
This commit is contained in:
Tom Lane
2000-01-09 00:26:47 +00:00
parent 69d4299e3e
commit 166b5c1def
35 changed files with 1239 additions and 1448 deletions

View File

@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: geqo_eval.c,v 1.44 1999/09/21 20:58:08 momjian Exp $
* $Id: geqo_eval.c,v 1.45 2000/01/09 00:26:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -95,7 +95,7 @@ geqo_eval(Query *root, Gene *tour, int num_gene)
joinrel = gimme_tree(root, tour, 0, num_gene, NULL);
/* compute fitness */
fitness = (Cost) joinrel->cheapestpath->path_cost;
fitness = joinrel->cheapestpath->path_cost;
/* restore join_rel_list */
root->join_rel_list = savelist;
@@ -177,16 +177,14 @@ gimme_tree(Query *root, Gene *tour, int rel_count, int num_gene, RelOptInfo *old
elog(DEBUG, "gimme_tree: still %d relations left", length(new_rels));
}
rels_set_cheapest(new_rels);
rels_set_cheapest(root, new_rels);
/* get essential new relation */
new_rel = (RelOptInfo *) lfirst(new_rels);
rel_count++;
/* processing of other new_rel attributes */
if (new_rel->size <= 0)
new_rel->size = compute_rel_size(new_rel);
new_rel->width = compute_rel_width(new_rel);
set_rel_rows_width(root, new_rel);
root->join_rel_list = lcons(new_rel, NIL);

View File

@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: geqo_misc.c,v 1.24 1999/08/16 02:17:48 tgl Exp $
* $Id: geqo_misc.c,v 1.25 2000/01/09 00:26:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -177,10 +177,9 @@ geqo_print_path(Query *root, Path *path, int indent)
}
if (join)
{
int size = path->parent->size;
jp = (JoinPath *) path;
printf("%s size=%d cost=%f\n", ptype, size, path->path_cost);
printf("%s rows=%.0f cost=%f\n",
ptype, path->parent->rows, path->path_cost);
switch (nodeTag(path))
{
case T_MergePath:
@@ -188,7 +187,7 @@ geqo_print_path(Query *root, Path *path, int indent)
for (i = 0; i < indent + 1; i++)
printf("\t");
printf(" clauses=(");
geqo_print_joinclauses(root, ((JoinPath *) path)->pathinfo);
geqo_print_joinclauses(root, path->parent->restrictinfo);
printf(")\n");
if (nodeTag(path) == T_MergePath)
@@ -213,11 +212,10 @@ geqo_print_path(Query *root, Path *path, int indent)
}
else
{
int size = path->parent->size;
int relid = lfirsti(path->parent->relids);
printf("%s(%d) size=%d cost=%f\n",
ptype, relid, size, path->path_cost);
printf("%s(%d) rows=%.0f cost=%f\n",
ptype, relid, path->parent->rows, path->path_cost);
if (IsA(path, IndexPath))
{
@@ -236,7 +234,7 @@ geqo_print_rel(Query *root, RelOptInfo *rel)
printf("(");
foreach(l, rel->relids)
printf("%d ", lfirsti(l));
printf("): size=%d width=%d\n", rel->size, rel->width);
printf("): rows=%.0f width=%d\n", rel->rows, rel->width);
printf("\tpath list:\n");
foreach(l, rel->pathlist)