mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
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.
This commit is contained in:
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user