diff options
Diffstat (limited to 'src/backend/commands/analyze.c')
-rw-r--r-- | src/backend/commands/analyze.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index 33447b671f1..176ebde0efd 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.133 2009/01/22 20:16:01 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.134 2009/03/24 20:17:13 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -496,6 +496,28 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt, /* We skip to here if there were no analyzable columns */ cleanup: + /* If this isn't part of VACUUM ANALYZE, let index AMs do cleanup */ + if (!vacstmt->vacuum) + { + for (ind = 0; ind < nindexes; ind++) + { + IndexBulkDeleteResult *stats; + IndexVacuumInfo ivinfo; + + ivinfo.index = Irel[ind]; + ivinfo.vacuum_full = false; + ivinfo.analyze_only = true; + ivinfo.message_level = elevel; + ivinfo.num_heap_tuples = -1; /* not known for sure */ + ivinfo.strategy = vac_strategy; + + stats = index_vacuum_cleanup(&ivinfo, NULL); + + if (stats) + pfree(stats); + } + } + /* Done with indexes */ vac_close_indexes(nindexes, Irel, NoLock); |