Skip to content

Commit ae12e25

Browse files
committed
Update optimizer comments.
1 parent 19cc38b commit ae12e25

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

src/backend/optimizer/path/prune.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.18 1999/02/04 01:46:58 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.19 1999/02/04 19:20:11 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -64,16 +64,18 @@ prune_joinrel(RelOptInfo *rel, List *other_rels)
6464
List *i = NIL;
6565
List *result = NIL;
6666

67-
foreach(i, other_rels)
67+
foreach(r1, other_rels)
6868
{
69-
RelOptInfo *other_rel = (RelOptInfo *) lfirst(i);
69+
RelOptInfo *other_rel = (RelOptInfo *) lfirst(r1);
7070

7171
if (same(rel->relids, other_rel->relids))
72-
{
72+
/*
73+
* This are on the same relations,
74+
* so get the best of their pathlists.
75+
*/
7376
rel->pathlist = add_pathlist(rel,
7477
rel->pathlist,
7578
other_rel->pathlist);
76-
}
7779
else
7880
result = nconc(result, lcons(other_rel, NIL));
7981
}

src/backend/optimizer/util/pathnode.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.17 1999/02/04 01:46:59 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.18 1999/02/04 19:20:12 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -101,21 +101,24 @@ set_cheapest(RelOptInfo *parent_rel, List *pathlist)
101101
List *
102102
add_pathlist(RelOptInfo *parent_rel, List *unique_paths, List *new_paths)
103103
{
104-
List *x;
105-
Path *new_path;
106-
Path *old_path;
107-
bool noOther;
104+
List *p1;
108105

109-
foreach(x, new_paths)
106+
foreach(p1, new_paths)
110107
{
111-
new_path = (Path *) lfirst(x);
108+
Path *new_path = (Path *) lfirst(p1);
109+
Path *old_path;
110+
bool noOther;
111+
112+
/* Is this new path already in unique_paths? */
112113
if (member(new_path, unique_paths))
113114
continue;
115+
116+
/* Find best matching path */
114117
old_path = better_path(new_path, unique_paths, &noOther);
115118

116119
if (noOther)
117120
{
118-
/* Is a brand new path. */
121+
/* This is a brand new path. */
119122
new_path->parent = parent_rel;
120123
unique_paths = lcons(new_path, unique_paths);
121124
}

0 commit comments

Comments
 (0)