@@ -765,9 +765,9 @@ lazy_scan_heap(Relation onerel, VacuumParams *params, LVRelStats *vacrelstats,
765
765
next_fsm_block_to_vacuum ;
766
766
double num_tuples , /* total number of nonremovable tuples */
767
767
live_tuples , /* live tuples (reltuples estimate) */
768
- tups_vacuumed , /* tuples cleaned up by vacuum */
768
+ tups_vacuumed , /* tuples cleaned up by current vacuum */
769
769
nkeep , /* dead-but-not-removable tuples */
770
- nunused ; /* unused line pointers */
770
+ nunused ; /* # existing unused line pointers */
771
771
IndexBulkDeleteResult * * indstats ;
772
772
int i ;
773
773
PGRUsage ru0 ;
@@ -1234,7 +1234,8 @@ lazy_scan_heap(Relation onerel, VacuumParams *params, LVRelStats *vacrelstats,
1234
1234
/*
1235
1235
* Prune all HOT-update chains in this page.
1236
1236
*
1237
- * We count tuples removed by the pruning step as removed by VACUUM.
1237
+ * We count tuples removed by the pruning step as removed by VACUUM
1238
+ * (existing LP_DEAD line pointers don't count).
1238
1239
*/
1239
1240
tups_vacuumed += heap_page_prune (onerel , buf , vistest , false,
1240
1241
InvalidTransactionId , 0 ,
@@ -1286,10 +1287,13 @@ lazy_scan_heap(Relation onerel, VacuumParams *params, LVRelStats *vacrelstats,
1286
1287
ItemPointerSet (& (tuple .t_self ), blkno , offnum );
1287
1288
1288
1289
/*
1289
- * DEAD line pointers are to be vacuumed normally; but we don't
1290
+ * LP_DEAD line pointers are to be vacuumed normally; but we don't
1290
1291
* count them in tups_vacuumed, else we'd be double-counting (at
1291
1292
* least in the common case where heap_page_prune() just freed up
1292
- * a non-HOT tuple).
1293
+ * a non-HOT tuple). Note also that the final tups_vacuumed value
1294
+ * might be very low for tables where opportunistic page pruning
1295
+ * happens to occur very frequently (via heap_page_prune_opt()
1296
+ * calls that free up non-HOT tuples).
1293
1297
*/
1294
1298
if (ItemIdIsDead (itemid ))
1295
1299
{
@@ -1742,10 +1746,6 @@ lazy_scan_heap(Relation onerel, VacuumParams *params, LVRelStats *vacrelstats,
1742
1746
vacrelstats -> relname ,
1743
1747
tups_vacuumed , vacuumed_pages )));
1744
1748
1745
- /*
1746
- * This is pretty messy, but we split it up so that we can skip emitting
1747
- * individual parts of the message when not applicable.
1748
- */
1749
1749
initStringInfo (& buf );
1750
1750
appendStringInfo (& buf ,
1751
1751
_ ("%.0f dead row versions cannot be removed yet, oldest xmin: %u\n" ),
0 commit comments