diff options
| author | Tom Lane | 2004-11-21 22:57:00 +0000 |
|---|---|---|
| committer | Tom Lane | 2004-11-21 22:57:00 +0000 |
| commit | 294c34bb9d8e253c3d8b0e0271e776fb0a992150 (patch) | |
| tree | 18282d0d66bc288524822c7576a9baafed78e091 | |
| parent | 7f1711f29dd6e44753d5845f707bda5fac6166a0 (diff) | |
Fix rounding problem in dynahash.c's decision about when the target
fill factor has been exceeded. We usually run with ffactor == 1, but
the way the test was coded, it wouldn't split a bucket until the actual
fill factor reached 2.0, because of use of integer division. Change
from > to >= so that it will split more aggressively when the table
starts to get full.
| -rw-r--r-- | src/backend/utils/hash/dynahash.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/hash/dynahash.c b/src/backend/utils/hash/dynahash.c index cf4e60e3c42..35398fb4c22 100644 --- a/src/backend/utils/hash/dynahash.c +++ b/src/backend/utils/hash/dynahash.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/hash/dynahash.c,v 1.56 2004/10/25 00:46:43 neilc Exp $ + * $PostgreSQL: pgsql/src/backend/utils/hash/dynahash.c,v 1.57 2004/11/21 22:57:00 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -662,7 +662,7 @@ hash_search(HTAB *hashp, /* caller is expected to fill the data field on return */ /* Check if it is time to split the segment */ - if (++hctl->nentries / (long) (hctl->max_bucket + 1) > hctl->ffactor) + if (++hctl->nentries / (long) (hctl->max_bucket + 1) >= hctl->ffactor) { /* * NOTE: failure to expand table is not a fatal error, it |
