lib/storage: reduce the maximum inverted index scans before giving up to label filters matching by metric name

The new value reduces the amount of wasted work during index scans over big number of time series.
This commit is contained in:
Aliaksandr Valialkin 2019-11-05 13:24:22 +02:00
parent d2f688c550
commit f48e97263c

View File

@ -2091,7 +2091,7 @@ func (is *indexSearch) updateMetricIDsAll(metricIDs *uint64set.Set, accountID, p
// The maximum number of index scan loops per already found metric.
// Bigger number of loops is slower than updateMetricIDsByMetricNameMatch
// over the found metrics.
const maxIndexScanLoopsPerMetric = 400
const maxIndexScanLoopsPerMetric = 100
func (is *indexSearch) intersectMetricIDsWithTagFilter(tf *tagFilter, filter *uint64set.Set) (*uint64set.Set, error) {
if filter.Len() == 0 {