postgresql/src/backend/utils/cache
Tom Lane f60d176a5e Tweak catalog cache management algorithms to reduce cost of
SearchCatCacheList and ReleaseCatCacheList.  Previously, we incremented
and decremented the refcounts of list member tuples along with the list
itself, but that's unnecessary, and very expensive when the list is big.
It's cheaper to change only the list refcount.  When we are considering
deleting a cache entry, we have to check not only its own refcount but
its parent list's ... but it's easy to arrange the code so that this
check is not made in any commonly-used paths, so the cost is really nil.
The bigger gain though is to refrain from DLMoveToFront'ing each individual
member tuple each time the list is referenced.  To keep some semblance
of fair space management, lists are just marked as used or not since the
last cache cleanout search, and we do a MoveToFront pass only when about
to run a cleanout.  In combination, these changes reduce the costs of
SearchCatCacheList and ReleaseCatCacheList from about 4.5% of pgbench
runtime to under 1%, according to my gprof results.
2005-08-13 22:18:07 +00:00
..
catcache.c Tweak catalog cache management algorithms to reduce cost of 2005-08-13 22:18:07 +00:00
inval.c Two-phase commit. Original patch by Heikki Linnakangas, with additional 2005-06-17 22:32:51 +00:00
lsyscache.c Pass the type OID as the typioparam for all non-array types, rather than 2005-08-12 21:49:47 +00:00
Makefile $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00
relcache.c Solve the problem of OID collisions by probing for duplicate OIDs 2005-08-12 01:36:05 +00:00
syscache.c Replace pg_shadow and pg_group by new role-capable catalogs pg_authid 2005-06-28 05:09:14 +00:00
typcache.c Modify hash_search() API to prevent future occurrences of the error 2005-05-29 04:23:07 +00:00