Change memory-space accounting mechanism in tuplesort.c and tuplestore.c
Tom Lane <tgl@sss.pgh.pa.us>
Change memory-space accounting mechanism in tuplesort.c and tuplestore.c to make a reasonable attempt at accounting for palloc overhead, not just the requested size of each memory chunk. Since in many scenarios this will make for a significant reduction in the amount of space acquired, partially compensate by doubling the default value of SORT_MEM to 1Mb. Per discussion in pgsql-general around 9-Jun-2002..
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/runtime.sgml | modified | +3 −3 |
| src/backend/utils/init/globals.c | modified | +2 −2 |
| src/backend/utils/misc/guc.c | modified | +2 −2 |
| src/backend/utils/misc/postgresql.conf.sample | modified | +1 −1 |
| src/backend/utils/mmgr/aset.c | modified | +19 −5 |
| src/backend/utils/mmgr/mcxt.c | modified | +34 −1 |
| src/backend/utils/sort/tuplesort.c | modified | +53 −88 |
| src/backend/utils/sort/tuplestore.c | modified | +18 −28 |
| src/include/nodes/memnodes.h | modified | +3 −2 |
| src/include/utils/memutils.h | modified | +4 −1 |