aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-02-03 17:34:04 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-02-03 17:34:04 +0000
commit391c3811a2b7f4cd666e1b4f35534046a862abbb (patch)
tree16e534067f9cb86d99b598675fbf3929589e6629 /src/backend/executor
parent39d715bee6f1eb1e7b90148368a22fe24f008185 (diff)
downloadpostgresql-391c3811a2b7f4cd666e1b4f35534046a862abbb.tar.gz
postgresql-391c3811a2b7f4cd666e1b4f35534046a862abbb.zip
Rename SortMem and VacuumMem to work_mem and maintenance_work_mem.
Make btree index creation and initial validation of foreign-key constraints use maintenance_work_mem rather than work_mem as their memory limit. Add some code to guc.c to allow these variables to be referenced by their old names in SHOW and SET commands, for backwards compatibility.
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/execQual.c4
-rw-r--r--src/backend/executor/nodeAgg.c4
-rw-r--r--src/backend/executor/nodeHash.c6
-rw-r--r--src/backend/executor/nodeIndexscan.c6
-rw-r--r--src/backend/executor/nodeMaterial.c4
-rw-r--r--src/backend/executor/nodeSort.c4
6 files changed, 15 insertions, 13 deletions
diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c
index bbed6f014b1..643a5da2e6b 100644
--- a/src/backend/executor/execQual.c
+++ b/src/backend/executor/execQual.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.153 2004/01/07 18:56:26 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.154 2004/02/03 17:34:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1116,7 +1116,7 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
0,
false);
}
- tupstore = tuplestore_begin_heap(true, false, SortMem);
+ tupstore = tuplestore_begin_heap(true, false, work_mem);
MemoryContextSwitchTo(oldcontext);
rsinfo.setResult = tupstore;
rsinfo.setDesc = tupdesc;
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index a2910fa420f..cb0a64c4277 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -45,7 +45,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeAgg.c,v 1.117 2003/11/29 19:51:48 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeAgg.c,v 1.118 2004/02/03 17:34:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -248,7 +248,7 @@ initialize_aggregates(AggState *aggstate,
peraggstate->sortstate =
tuplesort_begin_datum(peraggstate->inputType,
peraggstate->sortOperator,
- false);
+ work_mem, false);
}
/*
diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c
index 1e40aad4d6d..834c7afd6c1 100644
--- a/src/backend/executor/nodeHash.c
+++ b/src/backend/executor/nodeHash.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeHash.c,v 1.81 2003/11/29 19:51:48 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeHash.c,v 1.82 2004/02/03 17:34:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -348,9 +348,9 @@ ExecChooseHashTableSize(double ntuples, int tupwidth,
inner_rel_bytes = ntuples * tupsize * FUDGE_FAC;
/*
- * Target in-memory hashtable size is SortMem kilobytes.
+ * Target in-memory hashtable size is work_mem kilobytes.
*/
- hash_table_bytes = SortMem * 1024L;
+ hash_table_bytes = work_mem * 1024L;
/*
* Count the number of hash buckets we want for the whole relation,
diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c
index d7c62110e93..b6d6e5ac21e 100644
--- a/src/backend/executor/nodeIndexscan.c
+++ b/src/backend/executor/nodeIndexscan.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeIndexscan.c,v 1.90 2004/01/07 18:56:26 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeIndexscan.c,v 1.91 2004/02/03 17:34:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -40,7 +40,7 @@
* preferred way to do this is to record already-returned tuples in a hash
* table (using the TID as unique identifier). However, in a very large
* scan this could conceivably run out of memory. We limit the hash table
- * to no more than SortMem KB; if it grows past that, we fall back to the
+ * to no more than work_mem KB; if it grows past that, we fall back to the
* pre-7.4 technique: evaluate the prior-scan index quals again for each
* tuple (which is space-efficient, but slow).
*
@@ -1002,7 +1002,7 @@ create_duphash(IndexScanState *node)
HASHCTL hash_ctl;
long nbuckets;
- node->iss_MaxHash = (SortMem * 1024L) /
+ node->iss_MaxHash = (work_mem * 1024L) /
(MAXALIGN(sizeof(HASHELEMENT)) + MAXALIGN(sizeof(DupHashTabEntry)));
MemSet(&hash_ctl, 0, sizeof(hash_ctl));
hash_ctl.keysize = SizeOfIptrData;
diff --git a/src/backend/executor/nodeMaterial.c b/src/backend/executor/nodeMaterial.c
index fb98a334dbc..8be944243f4 100644
--- a/src/backend/executor/nodeMaterial.c
+++ b/src/backend/executor/nodeMaterial.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeMaterial.c,v 1.45 2003/11/29 19:51:48 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeMaterial.c,v 1.46 2004/02/03 17:34:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -62,7 +62,7 @@ ExecMaterial(MaterialState *node)
*/
if (tuplestorestate == NULL)
{
- tuplestorestate = tuplestore_begin_heap(true, false, SortMem);
+ tuplestorestate = tuplestore_begin_heap(true, false, work_mem);
node->tuplestorestate = (void *) tuplestorestate;
}
diff --git a/src/backend/executor/nodeSort.c b/src/backend/executor/nodeSort.c
index ed0cd313428..90c96ce7461 100644
--- a/src/backend/executor/nodeSort.c
+++ b/src/backend/executor/nodeSort.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeSort.c,v 1.46 2003/11/29 19:51:48 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeSort.c,v 1.47 2004/02/03 17:34:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -17,6 +17,7 @@
#include "executor/execdebug.h"
#include "executor/nodeSort.h"
+#include "miscadmin.h"
#include "utils/tuplesort.h"
@@ -88,6 +89,7 @@ ExecSort(SortState *node)
plannode->numCols,
plannode->sortOperators,
plannode->sortColIdx,
+ work_mem,
true /* randomAccess */ );
node->tuplesortstate = (void *) tuplesortstate;