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

Commit6de25f0

Browse files
committed
Optimizer cleanup.
1 parent4ea3f72 commit6de25f0

File tree

6 files changed

+45
-45
lines changed

6 files changed

+45
-45
lines changed

‎src/backend/optimizer/path/joinutils.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/Attic/joinutils.c,v 1.18 1999/02/1114:58:53 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.19 1999/02/1117:00:48 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -214,12 +214,12 @@ match_paths_joinkeys(List *joinkeys,
214214
foreach(i,paths)
215215
{
216216
Path*path= (Path*)lfirst(i);
217-
intmore_sort;
217+
intbetter_sort;
218218

219219
key_match=every_func(joinkeys,path->pathkeys,which_subkey);
220220

221-
if (pathorder_match(ordering,path->pathorder,&more_sort)&&
222-
more_sort==0&&
221+
if (pathorder_match(ordering,path->pathorder,&better_sort)&&
222+
better_sort==0&&
223223
length(joinkeys)==length(path->pathkeys)&&key_match)
224224
{
225225

‎src/backend/optimizer/util/keys.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/keys.c,v 1.15 1999/02/1104:08:42 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/keys.c,v 1.16 1999/02/1117:00:48 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -118,7 +118,7 @@ extract_join_subkey(JoinKey *jk, int which_subkey)
118118
*
119119
*/
120120
bool
121-
pathkeys_match(List*keys1,List*keys2,int*longer_key)
121+
pathkeys_match(List*keys1,List*keys2,int*better_key)
122122
{
123123
List*key1,
124124
*key2,
@@ -134,17 +134,17 @@ pathkeys_match(List *keys1, List *keys2, int *longer_key)
134134
key1a=lnext(key1a),key2a=lnext(key2a))
135135
if (!equal(lfirst(key1a),lfirst(key2a)))
136136
{
137-
*longer_key=0;
137+
*better_key=0;
138138
return false;
139139
}
140140
if (key1a!=NIL&&key2a==NIL)
141141
{
142-
*longer_key=1;
142+
*better_key=1;
143143
return true;
144144
}
145145
if (key1a==NIL&&key2a!=NIL)
146146
{
147-
*longer_key=2;
147+
*better_key=2;
148148
return true;
149149
}
150150
}
@@ -156,15 +156,15 @@ pathkeys_match(List *keys1, List *keys2, int *longer_key)
156156
*/
157157
if (key1!=NIL&&key2==NIL)
158158
{
159-
*longer_key=1;
159+
*better_key=1;
160160
return true;
161161
}
162162
if (key1==NIL&&key2!=NIL)
163163
{
164-
*longer_key=2;
164+
*better_key=2;
165165
return true;
166166
}
167-
*longer_key=0;
167+
*better_key=0;
168168
return true;
169169
}
170170

‎src/backend/optimizer/util/ordering.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/ordering.c,v 1.12 1999/02/1114:58:58 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/ordering.c,v 1.13 1999/02/1117:00:48 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -18,7 +18,7 @@
1818
#include"optimizer/internal.h"
1919
#include"optimizer/ordering.h"
2020

21-
staticboolequal_sortops_order(Oid*ordering1,Oid*ordering2,int*more_sort);
21+
staticboolequal_sortops_order(Oid*ordering1,Oid*ordering2,int*better_sort);
2222

2323
/*
2424
* equal-path-ordering--
@@ -28,23 +28,23 @@ static bool equal_sortops_order(Oid *ordering1, Oid *ordering2, int *more_sort);
2828
bool
2929
pathorder_match(PathOrder*path_ordering1,
3030
PathOrder*path_ordering2,
31-
int*more_sort)
31+
int*better_sort)
3232
{
3333

34-
*more_sort=0;
34+
*better_sort=0;
3535

3636
if (path_ordering1==path_ordering2)
3737
return true;
3838

3939
if (!path_ordering2)
4040
{
41-
*more_sort=1;
41+
*better_sort=1;
4242
return true;
4343
}
4444

4545
if (!path_ordering1)
4646
{
47-
*more_sort=2;
47+
*better_sort=2;
4848
return true;
4949
}
5050

@@ -58,14 +58,14 @@ pathorder_match(PathOrder *path_ordering1,
5858
{
5959
returnequal_sortops_order(path_ordering1->ord.sortop,
6060
path_ordering2->ord.sortop,
61-
more_sort);
61+
better_sort);
6262
}
6363
elseif (path_ordering1->ordtype==MERGE_ORDER&&
6464
path_ordering2->ordtype==SORTOP_ORDER)
6565
{
6666
if (!path_ordering2->ord.sortop)
6767
{
68-
*more_sort=1;
68+
*better_sort=1;
6969
return true;
7070
}
7171
returnpath_ordering1->ord.merge->left_operator==path_ordering2->ord.sortop[0];
@@ -74,7 +74,7 @@ pathorder_match(PathOrder *path_ordering1,
7474
{
7575
if (!path_ordering1->ord.sortop)
7676
{
77-
*more_sort=2;
77+
*better_sort=2;
7878
return true;
7979
}
8080
returnpath_ordering1->ord.sortop[0]==path_ordering2->ord.merge->left_operator;
@@ -127,24 +127,24 @@ equal_merge_ordering(MergeOrder *merge_ordering1,
127127
* Returns true iff the sort operators are in the same order.
128128
*/
129129
staticbool
130-
equal_sortops_order(Oid*ordering1,Oid*ordering2,int*more_sort)
130+
equal_sortops_order(Oid*ordering1,Oid*ordering2,int*better_sort)
131131
{
132132
inti=0;
133133

134-
*more_sort=0;
134+
*better_sort=0;
135135

136136
if (ordering1==ordering2)
137137
return true;
138138

139139
if (!ordering2)
140140
{
141-
*more_sort=1;
141+
*better_sort=1;
142142
return true;
143143
}
144144

145145
if (!ordering1)
146146
{
147-
*more_sort=2;
147+
*better_sort=2;
148148
return true;
149149
}
150150

@@ -157,13 +157,13 @@ equal_sortops_order(Oid *ordering1, Oid *ordering2, int *more_sort)
157157

158158
if (ordering1[i]!=0&&ordering2[i]==0)
159159
{
160-
*more_sort=1;
160+
*better_sort=1;
161161
return true;
162162
}
163163

164164
if (ordering1[i]==0&&ordering2[i]!=0)
165165
{
166-
*more_sort=2;
166+
*better_sort=2;
167167
return true;
168168
}
169169

‎src/backend/optimizer/util/pathnode.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/util/pathnode.c,v 1.27 1999/02/1116:09:41 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.28 1999/02/1117:00:49 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -157,16 +157,16 @@ better_path(Path *new_path, List *unique_paths, bool *is_new)
157157
{
158158
Path*path= (Path*)NULL;
159159
List*temp=NIL;
160-
intlonger_key;
161-
intmore_sort;
160+
intbetter_key;
161+
intbetter_sort;
162162

163163
foreach(temp,unique_paths)
164164
{
165165
path= (Path*)lfirst(temp);
166166

167167
#ifdefOPTDUP_DEBUG
168-
if (!pathkeys_match(new_path->pathkeys,path->pathkeys,&longer_key)||
169-
longer_key!=0)
168+
if (!pathkeys_match(new_path->pathkeys,path->pathkeys,&better_key)||
169+
better_key!=0)
170170
{
171171
printf("oldpath\n");
172172
pprint(path->pathkeys);
@@ -177,7 +177,7 @@ better_path(Path *new_path, List *unique_paths, bool *is_new)
177177
length(lfirst(path->pathkeys))<length(lfirst(new_path->pathkeys)))
178178
sleep(0);/* set breakpoint here */
179179
}
180-
if (!pathorder_match(new_path->pathorder,path->pathorder,&more_sort))
180+
if (!pathorder_match(new_path->pathorder,path->pathorder,&better_sort))
181181
{
182182
printf("oldord\n");
183183
pprint(path->pathorder);
@@ -186,9 +186,9 @@ better_path(Path *new_path, List *unique_paths, bool *is_new)
186186
}
187187
#endif
188188

189-
if (pathkeys_match(new_path->pathkeys,path->pathkeys,&longer_key))
189+
if (pathkeys_match(new_path->pathkeys,path->pathkeys,&better_key))
190190
{
191-
if (pathorder_match(new_path->pathorder,path->pathorder,&more_sort))
191+
if (pathorder_match(new_path->pathorder,path->pathorder,&better_sort))
192192
{
193193
/*
194194
* Replace pathkeys that match exactly, (1,2), (1,2).
@@ -198,12 +198,12 @@ better_path(Path *new_path, List *unique_paths, bool *is_new)
198198
* over unsorted keys in the same way.
199199
*/
200200
/* same keys, and new is cheaper, use it */
201-
if ((longer_key==0&&more_sort==0&&
201+
if ((better_key==0&&better_sort==0&&
202202
new_path->path_cost<path->path_cost)||
203203

204204
/* new is better, and cheaper, use it */
205-
((longer_key==1&&more_sort!=2)||
206-
(longer_key!=2&&more_sort==1))&&
205+
((better_key==1&&better_sort!=2)||
206+
(better_key!=2&&better_sort==1))&&
207207
new_path->path_cost <=path->path_cost)
208208
{
209209
*is_new= false;
@@ -212,12 +212,12 @@ better_path(Path *new_path, List *unique_paths, bool *is_new)
212212

213213
/* same keys, new is more expensive, stop */
214214
elseif
215-
((longer_key==0&&more_sort==0&&
215+
((better_key==0&&better_sort==0&&
216216
new_path->path_cost >=path->path_cost)||
217217

218218
/* old is better, and less expensive, stop */
219-
((longer_key==2&&more_sort!=1)||
220-
(longer_key!=1&&more_sort==2))&&
219+
((better_key==2&&better_sort!=1)||
220+
(better_key!=1&&better_sort==2))&&
221221
new_path->path_cost >=path->path_cost)
222222
{
223223
*is_new= false;

‎src/include/optimizer/keys.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: keys.h,v 1.10 1999/02/1104:08:44 momjian Exp $
9+
* $Id: keys.h,v 1.11 1999/02/1117:00:49 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -18,7 +18,7 @@
1818

1919
externboolmatch_indexkey_operand(intindexkey,Var*operand,RelOptInfo*rel);
2020
externVar*extract_join_subkey(JoinKey*jk,intwhich_subkey);
21-
externboolpathkeys_match(List*keys1,List*keys2,int*longer_key);
21+
externboolpathkeys_match(List*keys1,List*keys2,int*better_key);
2222
externList*collect_index_pathkeys(int*index_keys,List*tlist);
2323

2424
#endif/* KEYS_H */

‎src/include/optimizer/ordering.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: ordering.h,v 1.11 1999/02/1114:59:09 momjian Exp $
9+
* $Id: ordering.h,v 1.12 1999/02/1117:00:49 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -16,7 +16,7 @@
1616
#include<nodes/relation.h>
1717

1818
externboolpathorder_match(PathOrder*path_ordering1,
19-
PathOrder*path_ordering2,int*more_sort);
19+
PathOrder*path_ordering2,int*better_sort);
2020
externboolequal_path_merge_ordering(Oid*path_ordering,
2121
MergeOrder*merge_ordering);
2222
externboolequal_merge_ordering(MergeOrder*merge_ordering1,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp