aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access')
-rw-r--r--src/backend/access/common/reloptions.c2
-rw-r--r--src/backend/access/nbtree/nbtree.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c
index e0c9c3431c6..5671bb6830d 100644
--- a/src/backend/access/common/reloptions.c
+++ b/src/backend/access/common/reloptions.c
@@ -416,7 +416,7 @@ static relopt_real realRelOpts[] =
RELOPT_KIND_BTREE,
ShareUpdateExclusiveLock
},
- -1, 0.0, 100.0
+ -1, 0.0, DBL_MAX
},
/* list terminator */
{{NULL}}
diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c
index 27a3032e42a..cdd0403e1d8 100644
--- a/src/backend/access/nbtree/nbtree.c
+++ b/src/backend/access/nbtree/nbtree.c
@@ -816,6 +816,7 @@ _bt_vacuum_needs_cleanup(IndexVacuumInfo *info)
{
StdRdOptions *relopts;
float8 cleanup_scale_factor;
+ float8 prev_num_heap_tuples;
/*
* If table receives enough insertions and no cleanup was performed,
@@ -829,11 +830,12 @@ _bt_vacuum_needs_cleanup(IndexVacuumInfo *info)
relopts->vacuum_cleanup_index_scale_factor >= 0)
? relopts->vacuum_cleanup_index_scale_factor
: vacuum_cleanup_index_scale_factor;
+ prev_num_heap_tuples = metad->btm_last_cleanup_num_heap_tuples;
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)
+ prev_num_heap_tuples < 0 ||
+ (info->num_heap_tuples - prev_num_heap_tuples) /
+ prev_num_heap_tuples >= cleanup_scale_factor)
result = true;
}