postgresql/src
Tom Lane 8a7506e048 Reduce initial size of RelfilenodeMapHash.
A test case provided by Mathieu Fenniak shows that hash_seq_search'ing
this hashtable can consume a very significant amount of overhead during
logical decoding, which triggers frequent cache invalidation.  Testing
suggests that the actual population of the hashtable is often no more
than a few dozen entries, so we can cut the overhead just by dropping
the 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, we
shouldn't get any real penalty from doing this, as the dynahash.c code
will 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 cases
may have larger average table populations, but it's hard to see it
turning 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.com
2017-05-12 18:30:02 -04:00
..
backend Reduce initial size of RelfilenodeMapHash. 2017-05-12 18:30:02 -04:00
bin psql: Add missing translation markers 2017-05-10 10:15:53 -04:00
common pgindent run for 9.5 2015-05-23 21:35:49 -04:00
include Avoid searching for the target catcache in CatalogCacheIdInvalidate. 2017-05-12 18:17:29 -04:00
interfaces Stamp 9.5.7. 2017-05-08 17:17:18 -04:00
makefiles Link $(WIN32RES) into single-file modules only when PGFILEDESC is set. 2015-08-05 20:45:21 -04:00
pl Translation updates 2017-05-08 10:13:00 -04:00
port Stamp 9.5.7. 2017-05-08 17:17:18 -04:00
template AIX: Test the -qlonglong option before use. 2015-07-17 03:01:29 -04:00
test Match pg_user_mappings limits to information_schema.user_mapping_options. 2017-05-08 07:24:27 -07:00
timezone Guard against null t->tm_zone in strftime.c. 2017-05-07 12:33:22 -04:00
tools Honor PROVE_FLAGS environment setting 2017-05-12 11:26:40 -04:00
tutorial Remove no-longer-required function declarations. 2015-05-24 12:20:23 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00
Makefile.global.in Honor PROVE_FLAGS environment setting 2017-05-12 11:26:40 -04:00
Makefile.shlib Fix typos in comments. 2017-02-06 11:34:18 +02:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00