Skip to content

Commit cc24b84

Browse files
committed
psort cleanups.
1 parent 8fd7db8 commit cc24b84

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

src/backend/tcop/postgres.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/tcop/postgres.c,v 1.38 1997/08/06 05:08:37 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.39 1997/08/06 05:38:35 momjian Exp $
1111
*
1212
* NOTES
1313
* this is the "main" module of the postgres backend and
@@ -108,7 +108,7 @@ extern int lockingOff;
108108
extern int NBuffers;
109109

110110
int fsyncOff = 0;
111-
int SortMem = 512 * 1024;
111+
int SortMem = 512;
112112

113113
int dontExecute = 0;
114114
static int ShowStats;
@@ -1045,7 +1045,7 @@ PostgresMain(int argc, char *argv[])
10451045
* S - amount of sort memory to use in 1k bytes
10461046
* ----------------
10471047
*/
1048-
SortMem = atoi(optarg) * 1024;
1048+
SortMem = atoi(optarg);
10491049
break;
10501050

10511051
#ifdef NOT_USED
@@ -1292,7 +1292,7 @@ PostgresMain(int argc, char *argv[])
12921292
*/
12931293
if (IsUnderPostmaster == false) {
12941294
puts("\nPOSTGRES backend interactive interface");
1295-
puts("$Revision: 1.38 $ $Date: 1997/08/06 05:08:37 $");
1295+
puts("$Revision: 1.39 $ $Date: 1997/08/06 05:38:35 $");
12961296
}
12971297

12981298
/* ----------------

src/backend/utils/sort/psort.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.7 1997/08/06 04:45:39 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.8 1997/08/06 05:38:38 momjian Exp $
1111
*
1212
* NOTES
1313
* Sorts the first relation into the second relation.
@@ -123,10 +123,10 @@ psort_begin(Sort *node, int nkeys, ScanKey key)
123123
PS(node)->BytesRead = 0;
124124
PS(node)->BytesWritten = 0;
125125
PS(node)->treeContext.tupDesc =
126-
ExecGetTupType(outerPlan((Plan *)node));
126+
ExecGetTupType(outerPlan((Plan *)node));
127127
PS(node)->treeContext.nKeys = nkeys;
128128
PS(node)->treeContext.scanKeys = key;
129-
PS(node)->treeContext.sortMem = SortMem;
129+
PS(node)->treeContext.sortMem = SortMem * 1024;
130130

131131
PS(node)->Tuples = NULL;
132132
PS(node)->tupcount = 0;

src/include/utils/psort.h

Lines changed: 1 addition & 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: psort.h,v 1.4 1997/08/06 03:42:13 momjian Exp $
9+
* $Id: psort.h,v 1.5 1997/08/06 05:38:46 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -18,7 +18,6 @@
1818
#include "utils/lselect.h"
1919
#include "nodes/plannodes.h"
2020

21-
#define SORTMEM (1 << 18) /* 1/4 M - any static memory */
2221
#define MAXTAPES 7 /* 7--See Fig. 70, p273 */
2322
#define TAPEEXTLEN strlen("pg_psort.xxxxx.xxx") /* TEMPDIR/TAPEEXT */
2423
#define FREE(x) pfree((char *) x)

0 commit comments

Comments
 (0)