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

Commit31cce21

Browse files
committed
Fix bushy plans. Cleanup.
1 parentc82ca4c commit31cce21

File tree

22 files changed

+180
-363
lines changed

22 files changed

+180
-363
lines changed

‎src/backend/nodes/copyfuncs.c

Lines changed: 2 additions & 4 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.72 1999/02/15 05:21:01 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.73 1999/02/18 00:49:12 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1066,7 +1066,6 @@ _copyRelOptInfo(RelOptInfo * from)
10661066
Node_Copy(from,newnode,restrictinfo);
10671067
Node_Copy(from,newnode,joininfo);
10681068
Node_Copy(from,newnode,innerjoin);
1069-
Node_Copy(from,newnode,superrels);
10701069

10711070
returnnewnode;
10721071
}
@@ -1428,12 +1427,11 @@ _copyJoinInfo(JoinInfo *from)
14281427
*copy remainder of node
14291428
* ----------------
14301429
*/
1431-
newnode->unjoined_rels=listCopy(from->unjoined_rels);
1430+
newnode->unjoined_relids=listCopy(from->unjoined_relids);
14321431
Node_Copy(from,newnode,jinfo_restrictinfo);
14331432

14341433
newnode->mergejoinable=from->mergejoinable;
14351434
newnode->hashjoinable=from->hashjoinable;
1436-
newnode->bushy_inactive=from->bushy_inactive;
14371435

14381436
returnnewnode;
14391437
}

‎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.34 1999/02/15 05:21:02 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.35 1999/02/18 00:49:14 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->unjoined_rels,b->unjoined_rels))
529+
if (!equal(a->unjoined_relids,b->unjoined_relids))
530530
return false;
531531
if (!equal(a->jinfo_restrictinfo,b->jinfo_restrictinfo))
532532
return false;

‎src/backend/nodes/freefuncs.c

Lines changed: 2 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/Attic/freefuncs.c,v 1.12 1999/02/15 05:21:02 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.13 1999/02/18 00:49:14 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -740,7 +740,6 @@ _freeRelOptInfo(RelOptInfo *node)
740740
freeObject(node->restrictinfo);
741741
freeObject(node->joininfo);
742742
freeObject(node->innerjoin);
743-
freeObject(node->superrels);
744743

745744
pfree(node);
746745
}
@@ -1024,7 +1023,7 @@ _freeJoinInfo(JoinInfo *node)
10241023
*free remainder of node
10251024
* ----------------
10261025
*/
1027-
freeList(node->unjoined_rels);
1026+
freeList(node->unjoined_relids);
10281027
freeObject(node->jinfo_restrictinfo);
10291028

10301029
pfree(node);

‎src/backend/nodes/outfuncs.c

Lines changed: 4 additions & 4 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.74 1999/02/15 05:21:02 momjian Exp $
8+
* $Id: outfuncs.c,v 1.75 1999/02/18 00:49:14 momjian Exp $
99
*
1010
* NOTES
1111
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -61,7 +61,7 @@ _outIntList(StringInfo str, List *list)
6161
appendStringInfo(str,"(");
6262
foreach(l,list)
6363
{
64-
appendStringInfo(str," %d ",(int)lfirst(l));
64+
appendStringInfo(str," %d ",lfirsti(l));
6565
}
6666
appendStringInfo(str,")");
6767
}
@@ -1198,8 +1198,8 @@ _outHashInfo(StringInfo str, HashInfo *node)
11981198
staticvoid
11991199
_outJoinInfo(StringInfostr,JoinInfo*node)
12001200
{
1201-
appendStringInfo(str," JINFO :unjoined_rels ");
1202-
_outIntList(str,node->unjoined_rels);
1201+
appendStringInfo(str," JINFO :unjoined_relids ");
1202+
_outIntList(str,node->unjoined_relids);
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.58 1999/02/15 05:21:03 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.59 1999/02/18 00:49:15 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 :unjoined_rels */
1986-
local_node->unjoined_rels=toIntList(nodeRead(true));/* now read it */
1985+
token=lsptok(NULL,&length);/* get :unjoined_relids */
1986+
local_node->unjoined_relids=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/xfunc.crenamed to‎src/backend/optimizer/path/_deadcode/xfunc.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.28 1999/02/13 23:16:24 momjian Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/_deadcode/Attic/xfunc.c,v 1.1 1999/02/18 00:49:24 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -44,7 +44,7 @@
4444

4545
/* local funcs */
4646
staticintxfunc_card_unreferenced(Query*queryInfo,
47-
Expr*clause,Relidreferenced);
47+
Expr*clause,Relidsreferenced);
4848

4949
*/
5050

@@ -631,10 +631,10 @@ xfunc_width(LispValue clause)
631631
}
632632
elseif (IsA(clause,Param))
633633
{
634-
if (typeidTypeRelid(get_paramtype((Param)clause)))
634+
if (typeidTypeRelids(get_paramtype((Param)clause)))
635635
{
636636
/* Param node returns a tuple.Find its width */
637-
rd=heap_open(typeidTypeRelid(get_paramtype((Param)clause)));
637+
rd=heap_open(typeidTypeRelids(get_paramtype((Param)clause)));
638638
retval=xfunc_tuple_width(rd);
639639
heap_close(rd);
640640
}
@@ -724,9 +724,9 @@ xfunc_width(LispValue clause)
724724
*/
725725
staticCount
726726
xfunc_card_unreferenced(Query*queryInfo,
727-
LispValueclause,Relidreferenced)
727+
LispValueclause,Relidsreferenced)
728728
{
729-
Relidunreferenced,
729+
Relidsunreferenced,
730730
allrelids=LispNil;
731731
LispValuetemp;
732732

@@ -751,7 +751,7 @@ xfunc_card_unreferenced(Query *queryInfo,
751751
** multiple together cardinalities of a list relations.
752752
*/
753753
Count
754-
xfunc_card_product(Query*queryInfo,Relidrelids)
754+
xfunc_card_product(Query*queryInfo,Relidsrelids)
755755
{
756756
LispValuecinfonode;
757757
LispValuetemp;
@@ -1310,9 +1310,9 @@ xfunc_func_width(RegProcedure funcid, LispValue args)
13101310
proc= (Form_pg_proc)GETSTRUCT(tupl);
13111311

13121312
/* if function returns a tuple, get the width of that */
1313-
if (typeidTypeRelid(proc->prorettype))
1313+
if (typeidTypeRelids(proc->prorettype))
13141314
{
1315-
rd=heap_open(typeidTypeRelid(proc->prorettype));
1315+
rd=heap_open(typeidTypeRelids(proc->prorettype));
13161316
retval=xfunc_tuple_width(rd);
13171317
heap_close(rd);
13181318
gotoexit;
@@ -1478,7 +1478,6 @@ xfunc_copyrel(RelOptInfo from, RelOptInfo *to)
14781478
Node_Copy(from,newnode,alloc,restrictinfo);
14791479
Node_Copy(from,newnode,alloc,joininfo);
14801480
Node_Copy(from,newnode,alloc,innerjoin);
1481-
Node_Copy(from,newnode,alloc,superrels);
14821481

14831482
(*to)=newnode;
14841483
return true;

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

Lines changed: 3 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.40 1999/02/16 00:40:59 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.41 1999/02/18 00:49:17 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -191,6 +191,8 @@ make_one_rel_by_joins(Query *root, List *rels, int levels_needed)
191191

192192
merge_rels_with_same_relids(joined_rels);
193193

194+
root->join_rel_list=rels=joined_rels;
195+
194196
#if0
195197
/*
196198
* * for each expensive predicate in each path in each distinct
@@ -203,17 +205,6 @@ make_one_rel_by_joins(Query *root, List *rels, int levels_needed)
203205

204206
rels_set_cheapest(joined_rels);
205207

206-
if (BushyPlanFlag)
207-
{
208-
/*
209-
* In case of bushy trees if there is still a join between a
210-
* join relation and another relation, add a new joininfo that
211-
* involves the join relation to the joininfo list of the
212-
* other relation
213-
*/
214-
add_rel_to_rel_joininfos(root,joined_rels,rels);
215-
}
216-
217208
foreach(x,joined_rels)
218209
{
219210
rel= (RelOptInfo*)lfirst(x);
@@ -228,20 +219,6 @@ make_one_rel_by_joins(Query *root, List *rels, int levels_needed)
228219
#endif
229220
}
230221

231-
if (BushyPlanFlag)
232-
{
233-
/*
234-
* prune rels that have been completely incorporated into new
235-
* join rels
236-
*/
237-
joined_rels=del_rels_all_bushy_inactive(rels);
238-
239-
/*
240-
* merge join rels if then contain the same list of base rels
241-
*/
242-
merge_rels_with_same_relids(joined_rels);
243-
}
244-
root->join_rel_list=rels=joined_rels;
245222
}
246223

247224
Assert(BushyPlanFlag||length(rels)==1);

‎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.50 1999/02/15 05:50:00 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.51 1999/02/18 00:49:18 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->unjoined_rels;
1211+
((RestrictInfo*)lfirst(clauses))->restrictinfojoinid=joininfo->unjoined_relids;
12121212
}
12131213
cg_list=nconc(cg_list,clausegroups);
12141214
}

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

Lines changed: 4 additions & 4 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.27 1999/02/15 03:22:05 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.28 1999/02/18 00:49:19 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -71,8 +71,8 @@ update_rels_pathlist_for_joins(Query *root, List *joinrels)
7171
foreach(j,joinrels)
7272
{
7373
RelOptInfo*joinrel= (RelOptInfo*)lfirst(j);
74-
List*innerrelids;
75-
List*outerrelids;
74+
Relidsinnerrelids;
75+
Relidsouterrelids;
7676
RelOptInfo*innerrel;
7777
RelOptInfo*outerrel;
7878
Path*bestinnerjoin;
@@ -163,7 +163,7 @@ update_rels_pathlist_for_joins(Query *root, List *joinrels)
163163
* Returns the pathnode of the selected path.
164164
*/
165165
staticPath*
166-
best_innerjoin(List*join_paths,List*outer_relids)
166+
best_innerjoin(List*join_paths,Relidsouter_relids)
167167
{
168168
Path*cheapest= (Path*)NULL;
169169
List*join_path;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp