Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit294c34b

Browse files
committed
Fix rounding problem in dynahash.c's decision about when the target
fill factor has been exceeded. We usually run with ffactor == 1, butthe way the test was coded, it wouldn't split a bucket until the actualfill factor reached 2.0, because of use of integer division. Changefrom > to >= so that it will split more aggressively when the tablestarts to get full.
1 parent7f1711f commit294c34b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/backend/utils/hash/dynahash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/utils/hash/dynahash.c,v 1.56 2004/10/25 00:46:43 neilc Exp $
12+
* $PostgreSQL: pgsql/src/backend/utils/hash/dynahash.c,v 1.57 2004/11/21 22:57:00 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -662,7 +662,7 @@ hash_search(HTAB *hashp,
662662
/* caller is expected to fill the data field on return */
663663

664664
/* Check if it is time to split the segment */
665-
if (++hctl->nentries / (long) (hctl->max_bucket+1)>hctl->ffactor)
665+
if (++hctl->nentries / (long) (hctl->max_bucket+1) >=hctl->ffactor)
666666
{
667667
/*
668668
* NOTE: failure to expand table is not a fatal error, it

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp