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

Commit10971a6

Browse files
committed
Allow set max number of tuples in leftist tree for sorts
(-S memory,tuples)
1 parent36b5484 commit10971a6

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

‎src/backend/tcop/postgres.c

Lines changed: 26 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/tcop/postgres.c,v 1.46 1997/09/15 14:28:16 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.47 1997/09/18 05:19:17 vadim Exp $
1111
*
1212
* NOTES
1313
* this is the "main" module of the postgres backend and
@@ -1120,10 +1120,32 @@ PostgresMain(int argc, char *argv[])
11201120

11211121
case'S':
11221122
/* ----------------
1123-
*S - amount of sort memory to use in 1k bytes
1123+
*S - amount of sort memory to use in 1k bytes and
1124+
*(optional) max number of tuples in leftist tree
11241125
* ----------------
11251126
*/
1126-
SortMem=atoi(optarg);
1127+
{
1128+
intS;
1129+
char*p=strchr (optarg,',');
1130+
1131+
if (p!=NULL )
1132+
{
1133+
*p=0;
1134+
S=atoi(optarg);
1135+
if (S >=4*MAXBLCKSZ/1024 )
1136+
SortMem=S;
1137+
S=atoi (p+1);
1138+
if (S >=32 )
1139+
SortTuplesInTree=S;
1140+
*p=',';
1141+
}
1142+
else
1143+
{
1144+
S=atoi(optarg);
1145+
if (S >=4*MAXBLCKSZ/1024 )
1146+
SortMem=S;
1147+
}
1148+
}
11271149
break;
11281150

11291151
case's':
@@ -1385,7 +1407,7 @@ PostgresMain(int argc, char *argv[])
13851407
if (IsUnderPostmaster== false)
13861408
{
13871409
puts("\nPOSTGRES backend interactive interface");
1388-
puts("$Revision: 1.46 $ $Date: 1997/09/15 14:28:16 $");
1410+
puts("$Revision: 1.47 $ $Date: 1997/09/18 05:19:17 $");
13891411
}
13901412

13911413
/* ----------------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp