postgresql/src/include/utils
Tom Lane 2df5d46555 Avoid searching for callback functions in CallSyscacheCallbacks().
We have now grown enough registerable syscache-invalidation callback
functions that the original assumption that there would be few of them
is causing performance problems.  In particular, let's fix things so that
CallSyscacheCallbacks doesn't have to search the whole array to find
which callback(s) to invoke for a given cache ID.  Preserve the original
behavior that callbacks are called in order of registration, just in
case there's someplace that depends on that (which I doubt).

In support of this, export the number of syscaches from syscache.h.
People could have found that out anyway from the enum, but adding a
#define makes that much safer.

This provides a useful additional speedup in Mathieu Fenniak's
logical-decoding test case, although we're reaching the point of
diminishing returns there.  I think any further improvement will have
to come from reducing the number of cache invalidations that are
triggered in the first place.  Still, we can hope that this change
gives some incremental benefit for all invalidation scenarios.

Back-patch to 9.4 where logical decoding was introduced.

Discussion: https://postgr.es/m/CAHoiPjzea6N0zuCi=+f9v_j94nfsy6y8SU7-=bp4=7qw6_i=Rg@mail.gmail.com
2017-05-12 19:05:27 -04:00
..
.gitignore Generate fmgr prototypes automatically 2017-01-17 14:06:07 -05:00
acl.h Implement multivariate n-distinct coefficients 2017-03-24 14:06:10 -03:00
aclchk_internal.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
array.h Remove create_singleton_array(), hard-coding the case in its sole caller. 2017-05-02 20:41:37 -04:00
arrayaccess.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
ascii.h Generate fmgr prototypes automatically 2017-01-17 14:06:07 -05:00
attoptcache.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
backend_random.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
builtins.h Collect duplicate copies of oid_cmp() 2017-03-01 11:55:28 -05:00
bytea.h Generate fmgr prototypes automatically 2017-01-17 14:06:07 -05:00
cash.h Generate fmgr prototypes automatically 2017-01-17 14:06:07 -05:00
catcache.h Avoid searching for the target catcache in CatalogCacheIdInvalidate. 2017-05-12 18:17:29 -04:00
combocid.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
date.h Remove now-dead code for !HAVE_INT64_TIMESTAMP. 2017-02-23 14:04:43 -05:00
datetime.h Remove now-dead code for !HAVE_INT64_TIMESTAMP. 2017-02-23 14:04:43 -05:00
datum.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
dsa.h Remove inclusion of postgres.h from a few header files. 2017-03-08 08:18:12 -05:00
dynahash.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
dynamic_loader.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
elog.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
evtcache.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
expandeddatum.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
fmgrtab.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
formatting.h Generate fmgr prototypes automatically 2017-01-17 14:06:07 -05:00
freepage.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
geo_decls.h Generate fmgr prototypes automatically 2017-01-17 14:06:07 -05:00
guc.h Make min_wal_size/max_wal_size use MB internally 2017-04-04 18:00:01 -04:00
guc_tables.h Add max_sync_workers_per_subscription to postgresql.conf.sample. 2017-04-12 00:10:54 +09:00
help_config.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
hsearch.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
index_selfuncs.h Add optimizer and executor support for parallel index scans. 2017-02-15 13:53:24 -05:00
inet.h Add support for EUI-64 MAC addresses as macaddr8 2017-03-15 11:16:25 -04:00
int8.h Generate fmgr prototypes automatically 2017-01-17 14:06:07 -05:00
inval.h Logical replication 2017-01-20 09:04:49 -05:00
json.h Generate fmgr prototypes automatically 2017-01-17 14:06:07 -05:00
jsonapi.h Transform or iterate over json(b) string values 2017-03-31 14:25:25 -04:00
jsonb.h Introduce convenience macros to hide JsonbContainer header accesses better. 2017-01-25 13:28:38 -05:00
logtape.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
lsyscache.h Identity columns 2017-04-06 08:41:37 -04:00
memdebug.h Make useful infrastructure from aset.c generally available. 2017-02-27 03:41:44 -08:00
memutils.h Reduce size of common allocation header. 2017-02-28 19:42:44 -08:00
nabstime.h Generate fmgr prototypes automatically 2017-01-17 14:06:07 -05:00
numeric.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
palloc.h chomp PQerrorMessage() in backend uses 2017-02-27 08:54:51 -05:00
pg_crc.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
pg_locale.h Fix cpluspluscheck warning 2017-03-26 18:31:05 -04:00
pg_lsn.h Generate fmgr prototypes automatically 2017-01-17 14:06:07 -05:00
pg_rusage.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
plancache.h Fix two undocumented parameters to functions from ENR patch. 2017-04-01 15:21:05 -05:00
portal.h Add infrastructure to support EphemeralNamedRelation references. 2017-03-31 23:17:18 -05:00
ps_status.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
queryenvironment.h Add infrastructure to support EphemeralNamedRelation references. 2017-03-31 23:17:18 -05:00
rangetypes.h Generate fmgr prototypes automatically 2017-01-17 14:06:07 -05:00
regproc.h Move some things from builtins.h to new header files 2017-01-20 20:29:53 -05:00
rel.h Implement multivariate n-distinct coefficients 2017-03-24 14:06:10 -03:00
relcache.h Implement multivariate n-distinct coefficients 2017-03-24 14:06:10 -03:00
relfilenodemap.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
relmapper.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
relptr.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
reltrigger.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
resowner.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
resowner_private.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
rls.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
ruleutils.h Improve error reporting for tuple-routing failures. 2017-03-03 09:09:52 +05:30
sampling.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
selfuncs.h Add security checks to selectivity estimation functions 2017-05-08 09:26:32 -04:00
snapmgr.h Always SnapshotResetXmin() during ClearTransaction() 2017-04-06 10:30:22 -04:00
snapshot.h Consistently declare timestamp variables as TimestampTz. 2017-02-23 15:57:08 -05:00
sortsupport.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
spccache.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
syscache.h Avoid searching for callback functions in CallSyscacheCallbacks(). 2017-05-12 19:05:27 -04:00
timeout.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
timestamp.h Consistently declare timestamp variables as TimestampTz. 2017-02-23 15:57:08 -05:00
tqual.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
tuplesort.h Allow avoiding tuple copy within tuplesort_gettupleslot(). 2017-04-06 14:48:59 -07:00
tuplestore.h Add infrastructure to support EphemeralNamedRelation references. 2017-03-31 23:17:18 -05:00
typcache.h Faster expression evaluation and targetlist projection. 2017-03-25 14:52:06 -07:00
tzparser.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
uuid.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
varbit.h Generate fmgr prototypes automatically 2017-01-17 14:06:07 -05:00
varlena.h Move some things from builtins.h to new header files 2017-01-20 20:29:53 -05:00
xml.h Faster expression evaluation and targetlist projection. 2017-03-25 14:52:06 -07:00