aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-08-12 00:36:12 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-08-12 00:36:12 +0000
commit77a7e9968bf109d11b87c40ba41d4b1a7f1d28ea (patch)
treee33aa3030956bcc878a3181e9cd31efad38b0d6c /src/include
parente44beef712144316cb83d32ccf3231a1503c9655 (diff)
downloadpostgresql-77a7e9968bf109d11b87c40ba41d4b1a7f1d28ea.tar.gz
postgresql-77a7e9968bf109d11b87c40ba41d4b1a7f1d28ea.zip
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..
Diffstat (limited to 'src/include')
-rw-r--r--src/include/nodes/memnodes.h5
-rw-r--r--src/include/utils/memutils.h5
2 files changed, 7 insertions, 3 deletions
diff --git a/src/include/nodes/memnodes.h b/src/include/nodes/memnodes.h
index 50ffcc0a742..9297db5e978 100644
--- a/src/include/nodes/memnodes.h
+++ b/src/include/nodes/memnodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: memnodes.h,v 1.24 2002/06/20 20:29:50 momjian Exp $
+ * $Id: memnodes.h,v 1.25 2002/08/12 00:36:12 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -42,10 +42,11 @@ typedef struct MemoryContextMethods
void (*init) (MemoryContext context);
void (*reset) (MemoryContext context);
void (*delete) (MemoryContext context);
+ Size (*get_chunk_space) (MemoryContext context, void *pointer);
+ void (*stats) (MemoryContext context);
#ifdef MEMORY_CONTEXT_CHECKING
void (*check) (MemoryContext context);
#endif
- void (*stats) (MemoryContext context);
} MemoryContextMethods;
diff --git a/src/include/utils/memutils.h b/src/include/utils/memutils.h
index 5e60c52fadd..771618ae56e 100644
--- a/src/include/utils/memutils.h
+++ b/src/include/utils/memutils.h
@@ -10,7 +10,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: memutils.h,v 1.46 2002/06/20 20:29:53 momjian Exp $
+ * $Id: memutils.h,v 1.47 2002/08/12 00:36:12 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -82,8 +82,11 @@ extern void MemoryContextDelete(MemoryContext context);
extern void MemoryContextResetChildren(MemoryContext context);
extern void MemoryContextDeleteChildren(MemoryContext context);
extern void MemoryContextResetAndDeleteChildren(MemoryContext context);
+extern Size GetMemoryChunkSpace(void *pointer);
extern void MemoryContextStats(MemoryContext context);
+#ifdef MEMORY_CONTEXT_CHECKING
extern void MemoryContextCheck(MemoryContext context);
+#endif
extern bool MemoryContextContains(MemoryContext context, void *pointer);
/*