File tree Expand file tree Collapse file tree 2 files changed +18
-13
lines changed Expand file tree Collapse file tree 2 files changed +18
-13
lines changed Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* 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 $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -64,16 +64,18 @@ prune_joinrel(RelOptInfo *rel, List *other_rels)
64
64
List * i = NIL ;
65
65
List * result = NIL ;
66
66
67
- foreach (i , other_rels )
67
+ foreach (r1 , other_rels )
68
68
{
69
- RelOptInfo * other_rel = (RelOptInfo * ) lfirst (i );
69
+ RelOptInfo * other_rel = (RelOptInfo * ) lfirst (r1 );
70
70
71
71
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
+ */
73
76
rel -> pathlist = add_pathlist (rel ,
74
77
rel -> pathlist ,
75
78
other_rel -> pathlist );
76
- }
77
79
else
78
80
result = nconc (result , lcons (other_rel , NIL ));
79
81
}
Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* 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 $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -101,21 +101,24 @@ set_cheapest(RelOptInfo *parent_rel, List *pathlist)
101
101
List *
102
102
add_pathlist (RelOptInfo * parent_rel , List * unique_paths , List * new_paths )
103
103
{
104
- List * x ;
105
- Path * new_path ;
106
- Path * old_path ;
107
- bool noOther ;
104
+ List * p1 ;
108
105
109
- foreach (x , new_paths )
106
+ foreach (p1 , new_paths )
110
107
{
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? */
112
113
if (member (new_path , unique_paths ))
113
114
continue ;
115
+
116
+ /* Find best matching path */
114
117
old_path = better_path (new_path , unique_paths , & noOther );
115
118
116
119
if (noOther )
117
120
{
118
- /* Is a brand new path. */
121
+ /* This is a brand new path. */
119
122
new_path -> parent = parent_rel ;
120
123
unique_paths = lcons (new_path , unique_paths );
121
124
}
You can’t perform that action at this time.
0 commit comments