mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +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/commands/analyze.c,v 1.40 2002/08/02 18:15:05 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.41 2002/08/05 03:29:16 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1670,7 +1670,6 @@ update_attstats(Oid relid, int natts, VacAttrStats **vacattrstats)
|
||||
Datum values[Natts_pg_statistic];
|
||||
char nulls[Natts_pg_statistic];
|
||||
char replaces[Natts_pg_statistic];
|
||||
Relation irelations[Num_pg_statistic_indices];
|
||||
|
||||
/* Ignore attr if we weren't able to collect stats */
|
||||
if (!stats->stats_valid)
|
||||
@ -1784,11 +1783,8 @@ update_attstats(Oid relid, int natts, VacAttrStats **vacattrstats)
|
||||
simple_heap_insert(sd, stup);
|
||||
}
|
||||
|
||||
/* update indices too */
|
||||
CatalogOpenIndices(Num_pg_statistic_indices, Name_pg_statistic_indices,
|
||||
irelations);
|
||||
CatalogIndexInsert(irelations, Num_pg_statistic_indices, sd, stup);
|
||||
CatalogCloseIndices(Num_pg_statistic_indices, irelations);
|
||||
/* update indexes too */
|
||||
CatalogUpdateIndexes(sd, stup);
|
||||
|
||||
heap_freetuple(stup);
|
||||
}
|
||||
|
Reference in New Issue
Block a user