@@ -1630,34 +1630,31 @@ lazy_scan_heap(LVRelState *vacrel, VacuumParams *params, bool aggressive)
1630
1630
update_index_statistics (vacrel );
1631
1631
1632
1632
/*
1633
- * If table has no indexes and at least one heap pages was vacuumed, make
1634
- * log report that lazy_vacuum_heap_rel would've made had there been
1635
- * indexes (having indexes implies using the two pass strategy).
1636
- *
1637
- * We deliberately don't do this in the case where there are indexes but
1638
- * index vacuuming was bypassed. We make a similar report at the point
1639
- * that index vacuuming is bypassed, but that's actually quite different
1640
- * in one important sense: it shows information about work we _haven't_
1641
- * done.
1642
- *
1643
- * log_autovacuum output does things differently; it consistently presents
1644
- * information about LP_DEAD items for the VACUUM as a whole. We always
1645
- * report on each round of index and heap vacuuming separately, though.
1633
+ * When the table has no indexes (i.e. in the one-pass strategy case),
1634
+ * make log report that lazy_vacuum_heap_rel would've made had there been
1635
+ * indexes. (As in the two-pass strategy case, only make this report when
1636
+ * there were LP_DEAD line pointers vacuumed in lazy_vacuum_heap_page.)
1646
1637
*/
1647
1638
if (vacrel -> nindexes == 0 && vacrel -> lpdead_item_pages > 0 )
1648
1639
ereport (elevel ,
1649
1640
(errmsg ("table \"%s\": removed %lld dead item identifiers in %u pages" ,
1650
1641
vacrel -> relname , (long long ) vacrel -> lpdead_items ,
1651
1642
vacrel -> lpdead_item_pages )));
1652
1643
1644
+ /*
1645
+ * Make a log report summarizing pruning and freezing.
1646
+ *
1647
+ * The autovacuum specific logging in heap_vacuum_rel summarizes an entire
1648
+ * VACUUM operation, whereas each VACUUM VERBOSE log report generally
1649
+ * summarizes a single round of index/heap vacuuming (or rel truncation).
1650
+ * It wouldn't make sense to report on pruning or freezing while following
1651
+ * that convention, though. You can think of this log report as a summary
1652
+ * of our first pass over the heap.
1653
+ */
1653
1654
initStringInfo (& buf );
1654
1655
appendStringInfo (& buf ,
1655
1656
_ ("%lld dead row versions cannot be removed yet, oldest xmin: %u\n" ),
1656
1657
(long long ) vacrel -> new_dead_tuples , vacrel -> OldestXmin );
1657
- appendStringInfo (& buf , ngettext ("%u page removed.\n" ,
1658
- "%u pages removed.\n" ,
1659
- vacrel -> pages_removed ),
1660
- vacrel -> pages_removed );
1661
1658
appendStringInfo (& buf , ngettext ("Skipped %u page due to buffer pins, " ,
1662
1659
"Skipped %u pages due to buffer pins, " ,
1663
1660
vacrel -> pinskipped_pages ),
@@ -2379,6 +2376,7 @@ lazy_vacuum_heap_rel(LVRelState *vacrel)
2379
2376
* We set all LP_DEAD items from the first heap pass to LP_UNUSED during
2380
2377
* the second heap pass. No more, no less.
2381
2378
*/
2379
+ Assert (tupindex > 0 );
2382
2380
Assert (vacrel -> num_index_scans > 1 ||
2383
2381
(tupindex == vacrel -> lpdead_items &&
2384
2382
vacuumed_pages == vacrel -> lpdead_item_pages ));
@@ -3293,7 +3291,7 @@ lazy_truncate_heap(LVRelState *vacrel)
3293
3291
vacrel -> rel_pages = new_rel_pages ;
3294
3292
3295
3293
ereport (elevel ,
3296
- (errmsg ("\"%s\": truncated %u to %u pages" ,
3294
+ (errmsg ("table \"%s\": truncated %u to %u pages" ,
3297
3295
vacrel -> relname ,
3298
3296
old_rel_pages , new_rel_pages ),
3299
3297
errdetail_internal ("%s" ,
@@ -3357,7 +3355,7 @@ count_nondeletable_pages(LVRelState *vacrel, bool *lock_waiter_detected)
3357
3355
if (LockHasWaitersRelation (vacrel -> rel , AccessExclusiveLock ))
3358
3356
{
3359
3357
ereport (elevel ,
3360
- (errmsg ("\"%s\": suspending truncate due to conflicting lock request" ,
3358
+ (errmsg ("table \"%s\": suspending truncate due to conflicting lock request" ,
3361
3359
vacrel -> relname )));
3362
3360
3363
3361
* lock_waiter_detected = true;
0 commit comments