diff options
| author | Tom Lane | 2005-06-26 23:32:34 +0000 |
|---|---|---|
| committer | Tom Lane | 2005-06-26 23:32:34 +0000 |
| commit | 06ae88a82e7fea5a1c3f8083581f1dd9d75fafc4 (patch) | |
| tree | 9fdb6c8e627fc2f00a21b0cb90c57795c5eaae77 /src/include | |
| parent | 943b396245bd699a66c894c5e11303b3ef93ac7b (diff) | |
Tweak dynahash.c to not allocate so many entries at once when dealing
with a table that has a small predicted size. Avoids wasting several
hundred K on the timezone hash table, which is likely to have only one
or a few entries, but the entries use up 10Kb apiece ...
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/utils/hsearch.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/include/utils/hsearch.h b/src/include/utils/hsearch.h index 5bd693063ac..b4bede7666e 100644 --- a/src/include/utils/hsearch.h +++ b/src/include/utils/hsearch.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/hsearch.h,v 1.38 2005/06/18 20:51:30 tgl Exp $ + * $PostgreSQL: pgsql/src/include/utils/hsearch.h,v 1.39 2005/06/26 23:32:34 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -97,6 +97,7 @@ typedef struct HASHHDR Size entrysize; /* total user element size in bytes */ long max_dsize; /* 'dsize' limit if directory is fixed * size */ + int nelem_alloc; /* number of entries to allocate at once */ HASHELEMENT *freeList; /* linked list of free elements */ #ifdef HASH_STATISTICS long accesses; @@ -158,8 +159,8 @@ typedef struct HASHCTL /* max_dsize value to indicate expansible directory */ #define NO_MAX_DSIZE (-1) -/* number of hash elements allocated at once */ -#define HASHELEMENT_ALLOC_INCR (32) +/* max number of hash elements allocated at once */ +#define HASHELEMENT_ALLOC_MAX (32) /* hash_search operations */ typedef enum |
