diff options
Diffstat (limited to 'src/backend/utils/cache/catcache.c')
| -rw-r--r-- | src/backend/utils/cache/catcache.c | 89 |
1 files changed, 1 insertions, 88 deletions
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c index aac1e87d87..8851e23661 100644 --- a/src/backend/utils/cache/catcache.c +++ b/src/backend/utils/cache/catcache.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/cache/catcache.c,v 1.149 2010/02/07 20:48:10 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/cache/catcache.c,v 1.150 2010/02/08 05:53:55 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -673,91 +673,6 @@ ResetCatalogCaches(void) } /* - * CatalogCacheFlushRelation - * - * This is called by RelationFlushRelation() to clear out cached information - * about a relation being dropped. (This could be a DROP TABLE command, - * or a temp table being dropped at end of transaction, or a table created - * during the current transaction that is being dropped because of abort.) - * Remove all cache entries relevant to the specified relation OID. - */ -void -CatalogCacheFlushRelation(Oid relId) -{ - CatCache *cache; - - CACHE2_elog(DEBUG2, "CatalogCacheFlushRelation called for %u", relId); - - for (cache = CacheHdr->ch_caches; cache; cache = cache->cc_next) - { - int i; - - /* We can ignore uninitialized caches, since they must be empty */ - if (cache->cc_tupdesc == NULL) - continue; - - /* Does this cache store tuples associated with relations at all? */ - if (cache->cc_reloidattr == 0) - continue; /* nope, leave it alone */ - - /* Yes, scan the tuples and remove those related to relId */ - for (i = 0; i < cache->cc_nbuckets; i++) - { - Dlelem *elt, - *nextelt; - - for (elt = DLGetHead(&cache->cc_bucket[i]); elt; elt = nextelt) - { - CatCTup *ct = (CatCTup *) DLE_VAL(elt); - Oid tupRelid; - - nextelt = DLGetSucc(elt); - - /* - * Negative entries are never considered related to a rel, - * even if the rel is part of their lookup key. - */ - if (ct->negative) - continue; - - if (cache->cc_reloidattr == ObjectIdAttributeNumber) - tupRelid = HeapTupleGetOid(&ct->tuple); - else - { - bool isNull; - - tupRelid = - DatumGetObjectId(fastgetattr(&ct->tuple, - cache->cc_reloidattr, - cache->cc_tupdesc, - &isNull)); - Assert(!isNull); - } - - if (tupRelid == relId) - { - if (ct->refcount > 0 || - (ct->c_list && ct->c_list->refcount > 0)) - { - ct->dead = true; - /* parent list must be considered dead too */ - if (ct->c_list) - ct->c_list->dead = true; - } - else - CatCacheRemoveCTup(cache, ct); -#ifdef CATCACHE_STATS - cache->cc_invals++; -#endif - } - } - } - } - - CACHE1_elog(DEBUG2, "end of CatalogCacheFlushRelation call"); -} - -/* * CatalogCacheFlushCatalog * * Flush all catcache entries that came from the specified system catalog. @@ -820,7 +735,6 @@ CatCache * InitCatCache(int id, Oid reloid, Oid indexoid, - int reloidattr, int nkeys, const int *key, int nbuckets) @@ -884,7 +798,6 @@ InitCatCache(int id, cp->cc_indexoid = indexoid; cp->cc_relisshared = false; /* temporary */ cp->cc_tupdesc = (TupleDesc) NULL; - cp->cc_reloidattr = reloidattr; cp->cc_ntup = 0; cp->cc_nbuckets = nbuckets; cp->cc_nkeys = nkeys; |
