]> granicus.if.org Git - postgresql/blobdiff - src/backend/commands/vacuumlazy.c
Skip ambulkdelete scan if there's nothing to delete and the index is not
[postgresql] / src / backend / commands / vacuumlazy.c
index a65c269fc8c8849b6b76e172f1da0d2075a73abc..2c1ba517638aaf76e1683c6a5b4796372abe0da5 100644 (file)
@@ -31,7 +31,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.65 2006/02/11 17:14:09 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.66 2006/02/11 23:31:34 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -625,6 +625,7 @@ lazy_scan_index(Relation indrel, LVRelStats *vacrelstats)
        /* Do post-VACUUM cleanup, even though we deleted nothing */
        vcinfo.vacuum_full = false;
        vcinfo.message_level = elevel;
+       vcinfo.num_heap_tuples = vacrelstats->rel_tuples;
 
        stats = index_vacuum_cleanup(indrel, &vcinfo, stats);
 
@@ -697,6 +698,9 @@ lazy_vacuum_index(Relation indrel,
        /* Do post-VACUUM cleanup */
        vcinfo.vacuum_full = false;
        vcinfo.message_level = elevel;
+       /* We don't yet know rel_tuples, so pass -1 */
+       /* index_bulk_delete can't have skipped scan anyway ... */
+       vcinfo.num_heap_tuples = -1;
 
        stats = index_vacuum_cleanup(indrel, &vcinfo, stats);