- Notifications
You must be signed in to change notification settings - Fork28
Commit8085a4f
committed
Reduce initial size of RelfilenodeMapHash.
A test case provided by Mathieu Fenniak shows that hash_seq_search'ingthis hashtable can consume a very significant amount of overhead duringlogical decoding, which triggers frequent cache invalidation. Testingsuggests that the actual population of the hashtable is often no morethan a few dozen entries, so we can cut the overhead just by droppingthe initial number of buckets down from 1024 --- I chose to cut it to 64.(In situations where we do have a significant number of entries, weshouldn't get any real penalty from doing this, as the dynahash.c codewill resize the hashtable automatically.)This gives a further factor-of-two savings in Mathieu's test case.That may be overly optimistic for real-world benefit, as real casesmay have larger average table populations, but it's hard to see itturning into a net negative for any workload.Back-patch to 9.4 where relfilenodemap.c was introduced.Discussion:https://postgr.es/m/CAHoiPjzea6N0zuCi=+f9v_j94nfsy6y8SU7-=bp4=7qw6_i=Rg@mail.gmail.com1 parent5e2af60 commit8085a4f
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
123 | 123 |
| |
124 | 124 |
| |
125 | 125 |
| |
126 |
| - | |
| 126 | + | |
127 | 127 |
| |
128 | 128 |
| |
129 | 129 |
| |
|
0 commit comments
Comments
(0)