Re: Division in dynahash.c due to HASH_FFACTOR
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: David Rowley <dgrowleyml@gmail.com>,
Jakub Wartak <Jakub.Wartak@tomtom.com>,
Alvaro Herrera <alvherre@2ndquadrant.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-09-19T01:11:46Z
Lists: pgsql-hackers
Thomas Munro <thomas.munro@gmail.com> writes:
> Pushed. Thanks Jakub, everyone.
BTW, looking over this patch, I wonder about
/*
* Can't split if running in partitioned mode, nor if frozen, nor if
* table is the subject of any active hash_seq_search scans. Strange
* order of these tests is to try to check cheaper conditions first.
*/
if (!IS_PARTITIONED(hctl) && !hashp->frozen &&
hctl->freeList[0].nentries > (long) (hctl->max_bucket + 1) &&
!has_seq_scans(hashp))
(void) expand_table(hashp);
ISTM that getting rid of the division obviates the concern that the
nentries condition is too expensive, and therefore we should revert
to checking it first, on the grounds that that condition is most
likely to fail.
regards, tom lane
Commits
-
Code review for dynahash change.
- ff28809feb44 14.0 landed
-
Remove large fill factor support from dynahash.c.
- be0a6666656e 14.0 landed