mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
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.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.87 2002/08/05 02:30:50 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.88 2002/08/05 03:29:16 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -236,15 +236,8 @@ ProcedureCreate(const char *procedureName,
|
||||
is_update = false;
|
||||
}
|
||||
|
||||
/* Need to update indices for either the insert or update case */
|
||||
if (RelationGetForm(rel)->relhasindex)
|
||||
{
|
||||
Relation idescs[Num_pg_proc_indices];
|
||||
|
||||
CatalogOpenIndices(Num_pg_proc_indices, Name_pg_proc_indices, idescs);
|
||||
CatalogIndexInsert(idescs, Num_pg_proc_indices, rel, tup);
|
||||
CatalogCloseIndices(Num_pg_proc_indices, idescs);
|
||||
}
|
||||
/* Need to update indexes for either the insert or update case */
|
||||
CatalogUpdateIndexes(rel, tup);
|
||||
|
||||
AssertTupleDescHasOid(tupDesc);
|
||||
retval = HeapTupleGetOid(tup);
|
||||
|
||||
Reference in New Issue
Block a user