From 23e078261e7c37f3c61c9a19beffe75252985a8e Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 4 Nov 2019 00:44:12 +0200 Subject: [PATCH] lib/storage: tune the returned value from adjustMaxMetricsAdaptive --- lib/storage/index_db.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/storage/index_db.go b/lib/storage/index_db.go index 4b66fc94e3..c0e6b76426 100644 --- a/lib/storage/index_db.go +++ b/lib/storage/index_db.go @@ -1316,10 +1316,10 @@ func (is *indexSearch) adjustMaxMetricsAdaptive(tr TimeRange, maxMetrics int) in return maxMetrics } hourMetrics := hmPrev.m.Len() - if hourMetrics >= 256 && maxMetrics > hourMetrics/4 { + if maxMetrics > hourMetrics { // It is cheaper to filter on the hour or day metrics if the minimum - // number of matching metrics across tfs exceeds hourMetrics / 4. - return hourMetrics / 4 + // number of matching metrics across tfs exceeds hourMetrics. + return hourMetrics } return maxMetrics }