]> granicus.if.org Git - postgresql/commitdiff
Update optimizer comments.
authorBruce Momjian <bruce@momjian.us>
Thu, 4 Feb 1999 19:20:12 +0000 (19:20 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 4 Feb 1999 19:20:12 +0000 (19:20 +0000)
src/backend/optimizer/path/prune.c
src/backend/optimizer/util/pathnode.c

index e65c4d7d67592c4fe11fb9d33cf4d1f5cf014b49..f3194605c7816ce8db4e25a946af82df0b7161fe 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.18 1999/02/04 01:46:58 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.19 1999/02/04 19:20:11 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -64,16 +64,18 @@ prune_joinrel(RelOptInfo *rel, List *other_rels)
        List       *i = NIL;
        List       *result = NIL;
 
-       foreach(i, other_rels)
+       foreach(r1, other_rels)
        {
-               RelOptInfo *other_rel = (RelOptInfo *) lfirst(i);
+               RelOptInfo *other_rel = (RelOptInfo *) lfirst(r1);
 
                if (same(rel->relids, other_rel->relids))
-               {
+                       /*
+                        *      This are on the same relations,
+                        *      so get the best of their pathlists.
+                        */
                        rel->pathlist = add_pathlist(rel,
                                                                                 rel->pathlist,
                                                                                 other_rel->pathlist);
-               }
                else
                        result = nconc(result, lcons(other_rel, NIL));
        }
index 7bdec4bb4aa5d621b48f38e6db8895c511d5ff51..e30421c374764b02fd392dc8f1ddcfa57af8f4e6 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.17 1999/02/04 01:46:59 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.18 1999/02/04 19:20:12 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -101,21 +101,24 @@ set_cheapest(RelOptInfo *parent_rel, List *pathlist)
 List *
 add_pathlist(RelOptInfo *parent_rel, List *unique_paths, List *new_paths)
 {
-       List       *x;
-       Path       *new_path;
-       Path       *old_path;
-       bool            noOther;
+       List       *p1;
 
-       foreach(x, new_paths)
+       foreach(p1, new_paths)
        {
-               new_path = (Path *) lfirst(x);
+               Path       *new_path = (Path *) lfirst(p1);
+               Path       *old_path;
+               bool            noOther;
+
+               /* Is this new path already in unique_paths? */
                if (member(new_path, unique_paths))
                        continue;
+
+               /* Find best matching path */
                old_path = better_path(new_path, unique_paths, &noOther);
 
                if (noOther)
                {
-                       /* Is a brand new path.  */
+                       /* This is a brand new path.  */
                        new_path->parent = parent_rel;
                        unique_paths = lcons(new_path, unique_paths);
                }