Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c5449d5

Browse files
committed
otherrels is now unjoined_rels
1 parent 82682ff commit c5449d5

File tree

12 files changed

+78
-84
lines changed

12 files changed

+78
-84
lines changed

src/backend/nodes/copyfuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.71 1999/02/15 03:21:58 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.72 1999/02/15 05:21:01 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1428,7 +1428,7 @@ _copyJoinInfo(JoinInfo *from)
14281428
* copy remainder of node
14291429
* ----------------
14301430
*/
1431-
newnode->otherrels = listCopy(from->otherrels);
1431+
newnode->unjoined_rels = listCopy(from->unjoined_rels);
14321432
Node_Copy(from, newnode, jinfo_restrictinfo);
14331433

14341434
newnode->mergejoinable = from->mergejoinable;

src/backend/nodes/equalfuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.33 1999/02/15 03:21:59 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.34 1999/02/15 05:21:02 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -526,7 +526,7 @@ _equalJoinInfo(JoinInfo *a, JoinInfo *b)
526526
{
527527
Assert(IsA(a, JoinInfo));
528528
Assert(IsA(b, JoinInfo));
529-
if (!equal(a->otherrels, b->otherrels))
529+
if (!equal(a->unjoined_rels, b->unjoined_rels))
530530
return false;
531531
if (!equal(a->jinfo_restrictinfo, b->jinfo_restrictinfo))
532532
return false;

src/backend/nodes/freefuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.11 1999/02/15 03:21:59 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.12 1999/02/15 05:21:02 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1024,7 +1024,7 @@ _freeJoinInfo(JoinInfo *node)
10241024
* free remainder of node
10251025
* ----------------
10261026
*/
1027-
freeList(node->otherrels);
1027+
freeList(node->unjoined_rels);
10281028
freeObject(node->jinfo_restrictinfo);
10291029

10301030
pfree(node);

src/backend/nodes/outfuncs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: outfuncs.c,v 1.73 1999/02/15 03:21:59 momjian Exp $
8+
* $Id: outfuncs.c,v 1.74 1999/02/15 05:21:02 momjian Exp $
99
*
1010
* NOTES
1111
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -1198,8 +1198,8 @@ _outHashInfo(StringInfo str, HashInfo *node)
11981198
static void
11991199
_outJoinInfo(StringInfo str, JoinInfo *node)
12001200
{
1201-
appendStringInfo(str, " JINFO :otherrels ");
1202-
_outIntList(str, node->otherrels);
1201+
appendStringInfo(str, " JINFO :unjoined_rels ");
1202+
_outIntList(str, node->unjoined_rels);
12031203

12041204
appendStringInfo(str, " :jinfo_restrictinfo ");
12051205
_outNode(str, node->jinfo_restrictinfo);

src/backend/nodes/readfuncs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.57 1999/02/13 23:16:02 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.58 1999/02/15 05:21:03 momjian Exp $
1111
*
1212
* NOTES
1313
* Most of the read functions for plan nodes are tested. (In fact, they
@@ -1982,8 +1982,8 @@ _readJoinInfo()
19821982

19831983
local_node = makeNode(JoinInfo);
19841984

1985-
token = lsptok(NULL, &length); /* get :otherrels */
1986-
local_node->otherrels = toIntList(nodeRead(true)); /* now read it */
1985+
token = lsptok(NULL, &length); /* get :unjoined_rels */
1986+
local_node->unjoined_rels = toIntList(nodeRead(true)); /* now read it */
19871987

19881988
token = lsptok(NULL, &length); /* get :jinfo_restrictinfo */
19891989
local_node->jinfo_restrictinfo = nodeRead(true); /* now read it */

src/backend/optimizer/path/allpaths.c

Lines changed: 19 additions & 26 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/allpaths.c,v 1.36 1999/02/15 03:59:27 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.37 1999/02/15 05:21:03 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -43,8 +43,9 @@ bool _use_geqo_ = false;
4343
int32 _use_geqo_rels_ = GEQO_RELS;
4444

4545

46-
static void find_base_rel_paths(Query *root, List *rels);
47-
static RelOptInfo *make_one_rel_by_joins(Query *root, List *outer_rels, int levels_needed);
46+
static void set_base_rel_pathlist(Query *root, List *rels);
47+
static RelOptInfo *make_one_rel_by_joins(Query *root, List *rels,
48+
int levels_needed);
4849

4950
#ifdef OPTIMIZER_DEBUG
5051
static void debug_print_rel(Query *root, RelOptInfo *rel);
@@ -71,7 +72,7 @@ make_one_rel(Query *root, List *rels)
7172
if (levels_needed <= 0)
7273
return NULL;
7374

74-
find_base_rel_paths(root, rels);
75+
set_base_rel_pathlist(root, rels);
7576

7677
if (levels_needed <= 1)
7778
{
@@ -83,7 +84,7 @@ make_one_rel(Query *root, List *rels)
8384
else
8485
{
8586
/*
86-
* this means that joins or sorts are required. set selectivities
87+
* This means that joins or sorts are required. set selectivities
8788
* of clauses that have not been set by an index.
8889
*/
8990
set_rest_relselec(root, rels);
@@ -93,7 +94,7 @@ make_one_rel(Query *root, List *rels)
9394
}
9495

9596
/*
96-
* find_base_rel_paths
97+
* set_base_rel_pathlist
9798
* Finds all paths available for scanning each relation entry in
9899
* 'rels'. Sequential scan and any available indices are considered
99100
* if possible(indices are not considered for lower nesting levels).
@@ -102,7 +103,7 @@ make_one_rel(Query *root, List *rels)
102103
* MODIFIES: rels
103104
*/
104105
static void
105-
find_base_rel_paths(Query *root, List *rels)
106+
set_base_rel_pathlist(Query *root, List *rels)
106107
{
107108
List *temp;
108109

@@ -150,7 +151,7 @@ find_base_rel_paths(Query *root, List *rels)
150151
* Find all possible joinpaths(bushy trees) for a query by systematically
151152
* finding ways to join relations(both original and derived) together.
152153
*
153-
* 'outer_rels' is the current list of relations for which join paths
154+
* 'rels' is the current list of relations for which join paths
154155
* are to be found, i.e., the current list of relations that
155156
* have already been derived.
156157
* 'levels_needed' is the number of iterations needed
@@ -159,7 +160,7 @@ find_base_rel_paths(Query *root, List *rels)
159160
* the result of joining all the original relations together.
160161
*/
161162
static RelOptInfo *
162-
make_one_rel_by_joins(Query *root, List *outer_rels, int levels_needed)
163+
make_one_rel_by_joins(Query *root, List *rels, int levels_needed)
163164
{
164165
List *x;
165166
List *joined_rels = NIL;
@@ -180,11 +181,11 @@ make_one_rel_by_joins(Query *root, List *outer_rels, int levels_needed)
180181
{
181182
/*
182183
* Determine all possible pairs of relations to be joined at this
183-
* level. Determine paths for joining these relation pairs and
184+
* level. Determine paths for joining these relation pairs and
184185
* modify 'joined_rels' accordingly, then eliminate redundant join
185186
* relations.
186187
*/
187-
joined_rels = make_rels_by_joins(root, outer_rels);
188+
joined_rels = make_rels_by_joins(root, rels);
188189

189190
update_rels_pathlist_for_joins(root, joined_rels);
190191

@@ -211,7 +212,7 @@ make_one_rel_by_joins(Query *root, List *outer_rels, int levels_needed)
211212
* involves the join relation to the joininfo list of the
212213
* other relation
213214
*/
214-
add_rel_to_rel_joininfos(root, joined_rels, outer_rels);
215+
add_rel_to_rel_joininfos(root, joined_rels, rels);
215216
}
216217
#endif
217218

@@ -236,33 +237,25 @@ make_one_rel_by_joins(Query *root, List *outer_rels, int levels_needed)
236237
* prune rels that have been completely incorporated into new
237238
* join rels
238239
*/
239-
outer_rels = del_rels_all_bushy_inactive(outer_rels);
240+
rels = del_rels_all_bushy_inactive(rels);
240241

241242
/*
242243
* merge join rels if then contain the same list of base rels
243244
*/
244-
outer_rels = merge_rels_with_same_relids(joined_rels, outer_rels);
245-
root->join_rel_list = outer_rels;
245+
joined_rels = merge_rels_with_same_relids(joined_rels, rels);
246246
}
247-
else
248247
#endif
249-
root->join_rel_list = joined_rels;
250-
251-
#ifdef NOT_USED
252-
if (!BushyPlanFlag)
253-
#endif
254-
outer_rels = joined_rels;
255-
248+
root->join_rel_list = rels = joined_rels;
256249
}
257250

258-
Assert(length(joined_rels) == 1);
251+
Assert(BushyPlanFlag || length(rels) == 1);
259252

260253
#ifdef NOT_USED
261254
if (BushyPlanFlag)
262-
return final_join_rels(outer_rels);
255+
return get_cheapest_complete_rel(rels);
263256
else
264257
#endif
265-
return lfirst(joined_rels);
258+
return lfirst(rels);
266259
}
267260

268261
/*****************************************************************************

src/backend/optimizer/path/indxpath.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.47 1999/02/15 03:22:05 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.48 1999/02/15 05:21:04 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1208,7 +1208,7 @@ indexable_joinclauses(RelOptInfo *rel, RelOptInfo *index,
12081208
{
12091209
List *clauses = lfirst(clausegroups);
12101210

1211-
((RestrictInfo *) lfirst(clauses))->restrictinfojoinid = joininfo->otherrels;
1211+
((RestrictInfo *) lfirst(clauses))->restrictinfojoinid = joininfo->unjoined_rels;
12121212
}
12131213
cg_list = nconc(cg_list, clausegroups);
12141214
}

0 commit comments

Comments
 (0)