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