summaryrefslogtreecommitdiff
path: root/src/backend/rewrite/rewriteSupport.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-08-05 03:29:17 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-08-05 03:29:17 +0000
commit15fe086fba52bbac7560151e06d1efb3daa69e4a (patch)
treef4213b8a0a5f0be0a4b3c990b5063b800961551f /src/backend/rewrite/rewriteSupport.c
parent07f9682de43ce53fcd6d86744f610cacfabc60bb (diff)
downloadpostgresql-15fe086fba52bbac7560151e06d1efb3daa69e4a.tar.gz
Restructure system-catalog index updating logic. Instead of having
hardwired lists of index names for each catalog, use the relcache's mechanism for caching lists of OIDs of indexes of any table. This reduces the common case of updating system catalog indexes to a single line, makes it much easier to add a new system index (in fact, you can now do so on-the-fly if you want to), and as a nice side benefit improves performance a little. Per recent pghackers discussion.
Diffstat (limited to 'src/backend/rewrite/rewriteSupport.c')
-rw-r--r--src/backend/rewrite/rewriteSupport.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/backend/rewrite/rewriteSupport.c b/src/backend/rewrite/rewriteSupport.c
index 3f4c7f2387..e55ceb8348 100644
--- a/src/backend/rewrite/rewriteSupport.c
+++ b/src/backend/rewrite/rewriteSupport.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.53 2002/07/12 18:43:17 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.54 2002/08/05 03:29:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -55,7 +55,6 @@ SetRelationRuleStatus(Oid relationId, bool relHasRules,
Relation relationRelation;
HeapTuple tuple;
Form_pg_class classForm;
- Relation idescs[Num_pg_class_indices];
/*
* Find the tuple to update in pg_class, using syscache for the
@@ -79,10 +78,8 @@ SetRelationRuleStatus(Oid relationId, bool relHasRules,
simple_heap_update(relationRelation, &tuple->t_self, tuple);
- /* Keep the catalog indices up to date */
- CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, idescs);
- CatalogIndexInsert(idescs, Num_pg_class_indices, relationRelation, tuple);
- CatalogCloseIndices(Num_pg_class_indices, idescs);
+ /* Keep the catalog indexes up to date */
+ CatalogUpdateIndexes(relationRelation, tuple);
}
else
{