diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-08-05 03:29:17 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-08-05 03:29:17 +0000 |
commit | 15fe086fba52bbac7560151e06d1efb3daa69e4a (patch) | |
tree | f4213b8a0a5f0be0a4b3c990b5063b800961551f /src/backend/commands/async.c | |
parent | 07f9682de43ce53fcd6d86744f610cacfabc60bb (diff) | |
download | postgresql-15fe086fba52bbac7560151e06d1efb3daa69e4a.tar.gz postgresql-15fe086fba52bbac7560151e06d1efb3daa69e4a.zip |
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/commands/async.c')
-rw-r--r-- | src/backend/commands/async.c | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c index 5f40f1617b6..4c7c5f21102 100644 --- a/src/backend/commands/async.c +++ b/src/backend/commands/async.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.87 2002/06/20 20:29:26 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.88 2002/08/05 03:29:16 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -245,14 +245,7 @@ Async_Listen(char *relname, int pid) simple_heap_insert(lRel, tuple); #ifdef NOT_USED /* currently there are no indexes */ - if (RelationGetForm(lRel)->relhasindex) - { - Relation idescs[Num_pg_listener_indices]; - - CatalogOpenIndices(Num_pg_listener_indices, Name_pg_listener_indices, idescs); - CatalogIndexInsert(idescs, Num_pg_listener_indices, lRel, tuple); - CatalogCloseIndices(Num_pg_listener_indices, idescs); - } + CatalogUpdateIndexes(lRel, tuple); #endif heap_freetuple(tuple); @@ -529,14 +522,7 @@ AtCommit_Notify(void) simple_heap_update(lRel, &lTuple->t_self, rTuple); #ifdef NOT_USED /* currently there are no indexes */ - if (RelationGetForm(lRel)->relhasindex) - { - Relation idescs[Num_pg_listener_indices]; - - CatalogOpenIndices(Num_pg_listener_indices, Name_pg_listener_indices, idescs); - CatalogIndexInsert(idescs, Num_pg_listener_indices, lRel, rTuple); - CatalogCloseIndices(Num_pg_listener_indices, idescs); - } + CatalogUpdateIndexes(lRel, rTuple); #endif } } @@ -802,14 +788,7 @@ ProcessIncomingNotify(void) simple_heap_update(lRel, &lTuple->t_self, rTuple); #ifdef NOT_USED /* currently there are no indexes */ - if (RelationGetForm(lRel)->relhasindex) - { - Relation idescs[Num_pg_listener_indices]; - - CatalogOpenIndices(Num_pg_listener_indices, Name_pg_listener_indices, idescs); - CatalogIndexInsert(idescs, Num_pg_listener_indices, lRel, rTuple); - CatalogCloseIndices(Num_pg_listener_indices, idescs); - } + CatalogUpdateIndexes(lRel, rTuple); #endif } } |