aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/array.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-11-08 19:24:38 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-11-08 19:24:38 +0000
commitfc5eb3f69a32f1bc5109576f5725dbdc33cdc1ca (patch)
tree462e5fc49f29a9e48e442ac423995257176a1d13 /src/include/utils/array.h
parenta5cf12e2ef775abf4cfe7dee50d2c065047e19a0 (diff)
downloadpostgresql-fc5eb3f69a32f1bc5109576f5725dbdc33cdc1ca.tar.gz
postgresql-fc5eb3f69a32f1bc5109576f5725dbdc33cdc1ca.zip
Tweak accumArrayResult() to double the size of its working arrays when
more space is needed, instead of incrementing by a fixed amount; the old method wastes lots of space and time when the ultimate size is large. Per gripe from Tatsuo.
Diffstat (limited to 'src/include/utils/array.h')
-rw-r--r--src/include/utils/array.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/include/utils/array.h b/src/include/utils/array.h
index a273ee765e1..791f6ebd999 100644
--- a/src/include/utils/array.h
+++ b/src/include/utils/array.h
@@ -49,7 +49,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/array.h,v 1.59 2006/09/10 20:14:20 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/utils/array.h,v 1.60 2006/11/08 19:24:38 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -78,13 +78,8 @@ typedef struct ArrayBuildState
MemoryContext mcontext; /* where all the temp stuff is kept */
Datum *dvalues; /* array of accumulated Datums */
bool *dnulls; /* array of is-null flags for Datums */
-
- /*
- * The allocated size of dvalues[] and dnulls[] is always a multiple of
- * ARRAY_ELEMS_CHUNKSIZE
- */
-#define ARRAY_ELEMS_CHUNKSIZE 64
- int nelems; /* number of valid Datums in dvalues[] */
+ int alen; /* allocated length of above arrays */
+ int nelems; /* number of valid entries in above arrays */
Oid element_type; /* data type of the Datums */
int16 typlen; /* needed info about datatype */
bool typbyval;