summaryrefslogtreecommitdiff
path: root/src/backend/commands/analyze.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/commands/analyze.c
parent07f9682de43ce53fcd6d86744f610cacfabc60bb (diff)
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/analyze.c')
-rw-r--r--src/backend/commands/analyze.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c
index 9844a5df0a9..5cabe21d5f9 100644
--- a/src/backend/commands/analyze.c
+++ b/src/backend/commands/analyze.c
@@ -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);
}