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

Commit757f403

Browse files
committed
Tighten coding in samekeys(). Pretty braindead change,
but it saves almost 10% of the runtime in Charles Hornberger's optimizerexample, so what the heck ...
1 parent6ca2bf6 commit757f403

File tree

1 file changed

+9
-5
lines changed
  • src/backend/optimizer/util

1 file changed

+9
-5
lines changed

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

Lines changed: 9 additions & 5 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.9 1998/09/01 04:30:07 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/keys.c,v 1.10 1999/02/01 04:20:50 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -120,16 +120,20 @@ extract_subkey(JoinKey *jk, int which_subkey)
120120
bool
121121
samekeys(List*keys1,List*keys2)
122122
{
123-
boolallmember= true;
124123
List*key1,
125124
*key2;
126125

127126
for (key1=keys1,key2=keys2;key1!=NIL&&key2!=NIL;
128127
key1=lnext(key1),key2=lnext(key2))
129128
if (!member(lfirst(key1),lfirst(key2)))
130-
allmember= false;
131-
132-
if ((length(keys2) >=length(keys1))&&allmember)
129+
return false;
130+
131+
/* Now the result should be true if list keys2 has at least as many
132+
* entries as keys1, ie, we did not fall off the end of keys2 first.
133+
* If key1 is now NIL then we hit the end of keys1 before or at the
134+
* same time as the end of keys2.
135+
*/
136+
if (key1==NIL)
133137
return true;
134138
else
135139
return false;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp