aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache/relcache.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-06-18 03:35:07 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-06-18 03:35:07 +0000
commit2c5aa2acb49d3aad560429295e3998e7aa7d7e7a (patch)
tree1f30a6323ec6b30478e0b44ac02ae442adeb500e /src/backend/utils/cache/relcache.c
parent41c377f5c6689fa95949fd7abd2d3a0d600d1be0 (diff)
downloadpostgresql-2c5aa2acb49d3aad560429295e3998e7aa7d7e7a.tar.gz
postgresql-2c5aa2acb49d3aad560429295e3998e7aa7d7e7a.zip
Do some restructuring to improve performance of the catcaches. Teach
CatalogCacheFlushRelation (formerly called SystemCacheRelationFlushed) how to distinguish tuples it should flush from those it needn't; this means a relcache flush event now only removes the catcache entries it ought to, rather than zapping the caches completely as it used to. Testing with the regression tests indicates that this considerably improves the lifespan of catcache entries. Also, rearrange catcache data structures so that the limit on number of cached tuples applies globally across all the catcaches, rather than being per-catcache. It was a little silly to have the same size limit on both, say, pg_attribute caches and pg_am caches (there being only four possible rows in the latter...). Doing LRU removal across all the caches instead of locally in each one should reduce cache reload traffic in the more heavily used caches and improve the efficiency of cache memory use.
Diffstat (limited to 'src/backend/utils/cache/relcache.c')
-rw-r--r--src/backend/utils/cache/relcache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 4c8c3c4398c..d44c3dc2340 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.137 2001/06/12 05:55:49 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.138 2001/06/18 03:35:07 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1657,7 +1657,7 @@ RelationClearRelation(Relation relation, bool rebuildIt)
MemoryContextSwitchTo(oldcxt);
/* Clear out catcache's entries for this relation */
- SystemCacheRelationFlushed(RelationGetRelid(relation));
+ CatalogCacheFlushRelation(RelationGetRelid(relation));
/*
* Free all the subsidiary data structures of the relcache entry. We