From cc24b846dd0adb42c17f793f4ffa0c8dd009224f Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Wed, 6 Aug 1997 05:38:46 +0000
Subject: [PATCH] psort cleanups.

---
 src/backend/tcop/postgres.c    | 8 ++++----
 src/backend/utils/sort/psort.c | 6 +++---
 src/include/utils/psort.h      | 3 +--
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 89d40a36e6e..f5809739a51 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.38 1997/08/06 05:08:37 momjian Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.39 1997/08/06 05:38:35 momjian Exp $
  *
  * NOTES
  *    this is the "main" module of the postgres backend and
@@ -108,7 +108,7 @@ extern int      lockingOff;
 extern int      NBuffers;
 
 int     fsyncOff = 0;
-int	SortMem = 512 * 1024;
+int	SortMem = 512;
 
 int     dontExecute = 0;
 static int      ShowStats;
@@ -1045,7 +1045,7 @@ PostgresMain(int argc, char *argv[])
              *  S - amount of sort memory to use in 1k bytes
              * ----------------
              */
-            SortMem = atoi(optarg) * 1024;
+            SortMem = atoi(optarg);
             break;
 
 #ifdef NOT_USED
@@ -1292,7 +1292,7 @@ PostgresMain(int argc, char *argv[])
      */
     if (IsUnderPostmaster == false) {
         puts("\nPOSTGRES backend interactive interface");
-        puts("$Revision: 1.38 $ $Date: 1997/08/06 05:08:37 $");
+        puts("$Revision: 1.39 $ $Date: 1997/08/06 05:38:35 $");
     }
     
     /* ----------------
diff --git a/src/backend/utils/sort/psort.c b/src/backend/utils/sort/psort.c
index 36acd5ec90c..df40b0809a1 100644
--- a/src/backend/utils/sort/psort.c
+++ b/src/backend/utils/sort/psort.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.7 1997/08/06 04:45:39 momjian Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.8 1997/08/06 05:38:38 momjian Exp $
  *
  * NOTES
  *      Sorts the first relation into the second relation.
@@ -123,10 +123,10 @@ psort_begin(Sort *node, int nkeys, ScanKey key)
     PS(node)->BytesRead = 0;
     PS(node)->BytesWritten = 0;
     PS(node)->treeContext.tupDesc =
-	ExecGetTupType(outerPlan((Plan *)node));
+    ExecGetTupType(outerPlan((Plan *)node));
     PS(node)->treeContext.nKeys = nkeys;
     PS(node)->treeContext.scanKeys = key;
-    PS(node)->treeContext.sortMem = SortMem;
+    PS(node)->treeContext.sortMem = SortMem * 1024;
 
     PS(node)->Tuples = NULL;
     PS(node)->tupcount = 0;
diff --git a/src/include/utils/psort.h b/src/include/utils/psort.h
index 7ece6090203..93e72061d08 100644
--- a/src/include/utils/psort.h
+++ b/src/include/utils/psort.h
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: psort.h,v 1.4 1997/08/06 03:42:13 momjian Exp $
+ * $Id: psort.h,v 1.5 1997/08/06 05:38:46 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -18,7 +18,6 @@
 #include "utils/lselect.h"
 #include "nodes/plannodes.h"
 
-#define	SORTMEM		(1 << 18)		/* 1/4 M - any static memory */
 #define	MAXTAPES	7			/* 7--See Fig. 70, p273 */
 #define	TAPEEXTLEN	strlen("pg_psort.xxxxx.xxx")	/* TEMPDIR/TAPEEXT */
 #define	FREE(x)		pfree((char *) x)
-- 
GitLab