commit da90c3f38c15f4f22a40b5742a0693925f892d15 Author: Alexander Korotkov Date: Mon May 7 19:10:41 2018 +0300 Fix condition for B-tree index cleanup Zero value of vacuum_cleanup_index_scale_factor means that user wants B-tree index cleanup to be never skipped. diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c index e5dce00876..d894ba0374 100644 --- a/src/backend/access/nbtree/nbtree.c +++ b/src/backend/access/nbtree/nbtree.c @@ -829,7 +829,7 @@ _bt_vacuum_needs_cleanup(IndexVacuumInfo *info) ? relopts->vacuum_cleanup_index_scale_factor : vacuum_cleanup_index_scale_factor; - if (cleanup_scale_factor < 0 || + if (cleanup_scale_factor <= 0 || metad->btm_last_cleanup_num_heap_tuples < 0 || info->num_heap_tuples > (1.0 + cleanup_scale_factor) * metad->btm_last_cleanup_num_heap_tuples)