Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd8b482b

Browse files
committed
optimizer cleanup.
1 parent808a6df commitd8b482b

File tree

2 files changed

+15
-43
lines changed

2 files changed

+15
-43
lines changed

‎src/backend/optimizer/path/allpaths.c

Lines changed: 14 additions & 14 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.33 1999/02/14 05:14:08 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.34 1999/02/14 05:27:11 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -162,7 +162,7 @@ static List *
162162
find_join_paths(Query*root,List*outer_rels,intlevels_needed)
163163
{
164164
List*x;
165-
List*new_rels=NIL;
165+
List*joined_rels=NIL;
166166
RelOptInfo*rel;
167167

168168
/*******************************************
@@ -181,26 +181,26 @@ find_join_paths(Query *root, List *outer_rels, int levels_needed)
181181
/*
182182
* Determine all possible pairs of relations to be joined at this
183183
* level. Determine paths for joining these relation pairs and
184-
* modify 'new_rels' accordingly, then eliminate redundant join
184+
* modify 'joined_rels' accordingly, then eliminate redundant join
185185
* relations.
186186
*/
187-
new_rels=make_new_rels_by_joins(root,outer_rels);
187+
joined_rels=make_new_rels_by_joins(root,outer_rels);
188188

189-
update_rels_pathlist_for_joins(root,new_rels);
189+
update_rels_pathlist_for_joins(root,joined_rels);
190190

191-
merge_rels_with_same_relids(new_rels);
191+
merge_rels_with_same_relids(joined_rels);
192192

193193
#if0
194194
/*
195195
* * for each expensive predicate in each path in each distinct
196196
* rel, * consider doing pullup -- JMH
197197
*/
198198
if (XfuncMode!=XFUNC_NOPULL&&XfuncMode!=XFUNC_OFF)
199-
foreach(x,new_rels)
199+
foreach(x,joined_rels)
200200
xfunc_trypullup((RelOptInfo*)lfirst(x));
201201
#endif
202202

203-
rels_set_cheapest(new_rels);
203+
rels_set_cheapest(joined_rels);
204204

205205
if (BushyPlanFlag)
206206
{
@@ -211,10 +211,10 @@ find_join_paths(Query *root, List *outer_rels, int levels_needed)
211211
* involves the join relation to the joininfo list of the
212212
* other relation
213213
*/
214-
add_new_joininfos(root,new_rels,outer_rels);
214+
add_new_joininfos(root,joined_rels,outer_rels);
215215
}
216216

217-
foreach(x,new_rels)
217+
foreach(x,joined_rels)
218218
{
219219
rel= (RelOptInfo*)lfirst(x);
220220

@@ -239,20 +239,20 @@ find_join_paths(Query *root, List *outer_rels, int levels_needed)
239239
/*
240240
* merge join rels if then contain the same list of base rels
241241
*/
242-
outer_rels=merge_joinrels(new_rels,outer_rels);
242+
outer_rels=merge_joinrels(joined_rels,outer_rels);
243243
root->join_rel_list=outer_rels;
244244
}
245245
else
246-
root->join_rel_list=new_rels;
246+
root->join_rel_list=joined_rels;
247247

248248
if (!BushyPlanFlag)
249-
outer_rels=new_rels;
249+
outer_rels=joined_rels;
250250
}
251251

252252
if (BushyPlanFlag)
253253
returnfinal_join_rels(outer_rels);
254254
else
255-
returnnew_rels;
255+
returnjoined_rels;
256256
}
257257

258258
/*****************************************************************************

‎src/backend/optimizer/path/joinpath.c

Lines changed: 1 addition & 29 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/joinpath.c,v 1.24 1999/02/1404:56:46 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.25 1999/02/1405:27:12 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -66,8 +66,6 @@ update_rels_pathlist_for_joins(Query *root, List *joinrels)
6666
{
6767
List*mergeinfo_list=NIL;
6868
List*hashinfo_list=NIL;
69-
List*temp_list=NIL;
70-
List*path=NIL;
7169
List*j;
7270

7371
foreach(j,joinrels)
@@ -144,37 +142,11 @@ update_rels_pathlist_for_joins(Query *root, List *joinrels)
144142
* 4. Consider paths where both outer and inner relations must be
145143
* hashed before being joined.
146144
*/
147-
148145
pathlist=add_pathlist(joinrel,pathlist,
149146
hash_inner_and_outer(joinrel,outerrel,
150147
innerrel,hashinfo_list));
151148

152149
joinrel->pathlist=pathlist;
153-
154-
/*
155-
* 'OuterJoinCost is only valid when calling
156-
* (match_unsorted_inner) with the same arguments as the previous
157-
* invokation of (match_unsorted_outer), so clear the field before
158-
* going on.
159-
*/
160-
temp_list=innerrel->pathlist;
161-
foreach(path,temp_list)
162-
{
163-
/*
164-
* XXX
165-
*
166-
* This gross hack is to get around an apparent optimizer bug on
167-
* Sparc (or maybe it is a bug of ours?) that causes really
168-
* wierd behavior.
169-
*/
170-
if (IsA_JoinPath(path))
171-
((Path*)lfirst(path))->outerjoincost= (Cost)0;
172-
173-
/*
174-
* do it iff it is a join path, which is not always true, esp
175-
* since the base level
176-
*/
177-
}
178150
}
179151
}
180152

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp