postgresql/src/backend
Tom Lane e384ed6cde Improve typcache: cache negative lookup results, add invalidation logic.
Previously, if the typcache had for example tried and failed to find a hash
opclass for a given data type, it would nonetheless repeat the unsuccessful
catalog lookup each time it was asked again.  This can lead to a
significant amount of useless bufmgr traffic, as in a recent report from
Scott Marlowe.  Like the catalog caches, typcache should be able to cache
negative results.  This patch arranges that by making use of separate flag
bits to remember whether a particular item has been looked up, rather than
treating a zero OID as an indicator that no lookup has been done.

Also, install a credible invalidation mechanism, namely watching for inval
events in pg_opclass.  The sole advantage of the lack of negative caching
was that the code would cope if operators or opclasses got added for a type
mid-session; to preserve that behavior we have to be able to invalidate
stale lookup results.  Updates in pg_opclass should be pretty rare in
production systems, so it seems sufficient to just invalidate all the
dependent data whenever one happens.

Adding proper invalidation also means that this code will now react sanely
if an opclass is dropped mid-session.  Arguably, that's a back-patchable
bug fix, but in view of the lack of complaints from the field I'll refrain
from back-patching.  (Probably, in most cases where an opclass is dropped,
the data type itself is dropped soon after, so that this misfeasance has
no bad consequences.)
2014-11-28 12:19:14 -05:00
..
access Fix assertion failure at end of PITR. 2014-11-28 09:31:53 +02:00
bootstrap Revert "Fix bogus %name-prefix option syntax in all our Bison files." 2014-05-28 19:21:01 -04:00
catalog Rename pg_rowsecurity -> pg_policy and other fixes 2014-11-27 01:15:57 -05:00
commands Rename pg_rowsecurity -> pg_policy and other fixes 2014-11-27 01:15:57 -05:00
executor Rename pg_rowsecurity -> pg_policy and other fixes 2014-11-27 01:15:57 -05:00
foreign Implement IMPORT FOREIGN SCHEMA. 2014-07-10 15:01:43 -04:00
lib pgindent run for 9.4 2014-05-06 12:12:18 -04:00
libpq Make Port->ssl_in_use available, even when built with !USE_SSL 2014-11-25 09:46:11 +02:00
main Add a basic atomic ops API abstracting away platform/architecture details. 2014-09-25 23:49:05 +02:00
nodes Support arrays as input to array_agg() and ARRAY(SELECT ...). 2014-11-25 12:21:28 -05:00
optimizer Rename pg_rowsecurity -> pg_policy and other fixes 2014-11-27 01:15:57 -05:00
parser Rename pg_rowsecurity -> pg_policy and other fixes 2014-11-27 01:15:57 -05:00
po Translation updates 2014-11-16 21:32:51 -05:00
port Add a basic atomic ops API abstracting away platform/architecture details. 2014-09-25 23:49:05 +02:00
postmaster action_at_recovery_target recovery config option 2014-11-25 20:13:30 +00:00
regex Fix incorrect search for "x?" style matches in creviterdissect(). 2014-09-23 20:26:14 -04:00
replication Allow using connection URI in primary_conninfo. 2014-11-25 18:26:05 +02:00
rewrite Rename pg_rowsecurity -> pg_policy and other fixes 2014-11-27 01:15:57 -05:00
snowball Finish adding file version information to installed Windows binaries. 2014-08-18 22:59:53 -04:00
storage Revamp the WAL record format. 2014-11-20 18:46:41 +02:00
tcop Explicitly support the case that a plancache's raw_parse_tree is NULL. 2014-11-12 15:59:01 -05:00
tsearch Cope with more than 64K phrases in a thesaurus dictionary. 2014-11-06 20:52:40 -05:00
utils Improve typcache: cache negative lookup results, add invalidation logic. 2014-11-28 12:19:14 -05:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
Makefile Get rid of use of dlltool in Mingw builds. 2014-02-11 12:56:20 -05:00
nls.mk Add libpgcommon to backend gettext source files 2013-10-19 13:49:05 -04:00