aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim B. Mikheev <vadim4o@yahoo.com>1997-09-18 05:19:17 +0000
committerVadim B. Mikheev <vadim4o@yahoo.com>1997-09-18 05:19:17 +0000
commit10971a6f8145aff4ee331f848d27ffd83a8668ba (patch)
treef4f41a2fe9dd3597f238ab698e0201a335da0064
parent36b54847cbbe0bf393b8dc3a03b3eb76a3e4788e (diff)
downloadpostgresql-10971a6f8145aff4ee331f848d27ffd83a8668ba.tar.gz
postgresql-10971a6f8145aff4ee331f848d27ffd83a8668ba.zip
Allow set max number of tuples in leftist tree for sorts
(-S memory,tuples)
-rw-r--r--src/backend/tcop/postgres.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 6c129bdec7c..b5aec218c7a 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.46 1997/09/15 14:28:16 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.47 1997/09/18 05:19:17 vadim Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -1120,10 +1120,32 @@ PostgresMain(int argc, char *argv[])
case 'S':
/* ----------------
- * S - amount of sort memory to use in 1k bytes
+ * S - amount of sort memory to use in 1k bytes and
+ * (optional) max number of tuples in leftist tree
* ----------------
*/
- SortMem = atoi(optarg);
+ {
+ int S;
+ char *p = strchr (optarg, ',');
+
+ if ( p != NULL )
+ {
+ *p = 0;
+ S = atoi(optarg);
+ if ( S >= 4*MAXBLCKSZ/1024 )
+ SortMem = S;
+ S = atoi (p + 1);
+ if ( S >= 32 )
+ SortTuplesInTree = S;
+ *p = ',';
+ }
+ else
+ {
+ S = atoi(optarg);
+ if ( S >= 4*MAXBLCKSZ/1024 )
+ SortMem = S;
+ }
+ }
break;
case 's':
@@ -1385,7 +1407,7 @@ PostgresMain(int argc, char *argv[])
if (IsUnderPostmaster == false)
{
puts("\nPOSTGRES backend interactive interface");
- puts("$Revision: 1.46 $ $Date: 1997/09/15 14:28:16 $");
+ puts("$Revision: 1.47 $ $Date: 1997/09/18 05:19:17 $");
}
/* ----------------