1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

Remove CatalogCacheFlushRelation, and the reloidattr infrastructure that was

needed by nothing else.

The restructuring I just finished doing on cache management exposed to me how
silly this routine was.  Its function was to go into the catcache and blow
away all entries related to a given relation when there was a relcache flush
on that relation.  However, there is no point in removing a catcache entry
if the catalog row it represents is still valid --- and if it isn't valid,
there must have been a catcache entry flush on it, because that's triggered
directly by heap_update or heap_delete on the catalog row.  So this routine
accomplished nothing except to blow away valid cache entries that we'd very
likely be wanting in the near future to help reconstruct the relcache entry.
Dumb.

On top of which, it required a subtle and easy-to-get-wrong attribute in
syscache definitions, ie, the column containing the OID of the related
relation if any.  Removing that is a very useful maintenance simplification.
This commit is contained in:
Tom Lane
2010-02-08 05:53:55 +00:00
parent 68446b2c87
commit 9a75803b1a
4 changed files with 6 additions and 167 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.303 2010/02/07 20:48:10 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.304 2010/02/08 05:53:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1916,13 +1916,6 @@ RelationClearRelation(Relation relation, bool rebuild)
/* Mark it invalid until we've finished rebuild */
relation->rd_isvalid = false;
/*
* Clear out catcache's entries for this relation. This is a bit of
* a hack, but it's a convenient place to do it. (XXX do we really
* still need this?)
*/
CatalogCacheFlushRelation(RelationGetRelid(relation));
/*
* If we're really done with the relcache entry, blow it away. But if
* someone is still using it, reconstruct the whole deal without moving
@ -2468,8 +2461,6 @@ RelationBuildLocalRelation(const char *relname,
*
* XXX this list had better match the relations specially handled in
* RelationCacheInitializePhase2/3.
*
* XXX do we need this at all??
*/
switch (relid)
{