aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/vacuum.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/vacuum.c')
-rw-r--r--src/backend/commands/vacuum.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index c1b17bba86b..ac45a5df69d 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.247 2003/02/09 06:56:27 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.248 2003/02/22 00:45:05 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2603,17 +2603,25 @@ static void
scan_index(Relation indrel, double num_tuples)
{
IndexBulkDeleteResult *stats;
+ IndexVacuumCleanupInfo vcinfo;
VacRUsage ru0;
vac_init_rusage(&ru0);
/*
- * Even though we're not planning to delete anything, use the
- * ambulkdelete call, so that the scan happens within the index AM for
- * more speed.
+ * Even though we're not planning to delete anything, we use the
+ * ambulkdelete call, because (a) the scan happens within the index AM
+ * for more speed, and (b) it may want to pass private statistics to
+ * the amvacuumcleanup call.
*/
stats = index_bulk_delete(indrel, dummy_tid_reaped, NULL);
+ /* Do post-VACUUM cleanup, even though we deleted nothing */
+ vcinfo.vacuum_full = true;
+ vcinfo.message_level = elevel;
+
+ stats = index_vacuum_cleanup(indrel, &vcinfo, stats);
+
if (!stats)
return;
@@ -2622,9 +2630,9 @@ scan_index(Relation indrel, double num_tuples)
stats->num_pages, stats->num_index_tuples,
false);
- elog(elevel, "Index %s: Pages %u; Tuples %.0f.\n\t%s",
+ elog(elevel, "Index %s: Pages %u, %u free; Tuples %.0f.\n\t%s",
RelationGetRelationName(indrel),
- stats->num_pages, stats->num_index_tuples,
+ stats->num_pages, stats->pages_free, stats->num_index_tuples,
vac_show_rusage(&ru0));
/*
@@ -2661,6 +2669,7 @@ vacuum_index(VacPageList vacpagelist, Relation indrel,
double num_tuples, int keep_tuples)
{
IndexBulkDeleteResult *stats;
+ IndexVacuumCleanupInfo vcinfo;
VacRUsage ru0;
vac_init_rusage(&ru0);
@@ -2668,6 +2677,12 @@ vacuum_index(VacPageList vacpagelist, Relation indrel,
/* Do bulk deletion */
stats = index_bulk_delete(indrel, tid_reaped, (void *) vacpagelist);
+ /* Do post-VACUUM cleanup */
+ vcinfo.vacuum_full = true;
+ vcinfo.message_level = elevel;
+
+ stats = index_vacuum_cleanup(indrel, &vcinfo, stats);
+
if (!stats)
return;
@@ -2676,8 +2691,9 @@ vacuum_index(VacPageList vacpagelist, Relation indrel,
stats->num_pages, stats->num_index_tuples,
false);
- elog(elevel, "Index %s: Pages %u; Tuples %.0f: Deleted %.0f.\n\t%s",
- RelationGetRelationName(indrel), stats->num_pages,
+ elog(elevel, "Index %s: Pages %u, %u free; Tuples %.0f: Deleted %.0f.\n\t%s",
+ RelationGetRelationName(indrel),
+ stats->num_pages, stats->pages_free,
stats->num_index_tuples - keep_tuples, stats->tuples_removed,
vac_show_rusage(&ru0));