lib/storage: correct tagfilter match cost (#1079)

This commit is contained in:
faceair 2021-02-23 03:46:56 +08:00 committed by Aliaksandr Valialkin
parent 5dbe88a1c6
commit b1409a7413

View file

@ -2483,7 +2483,7 @@ func (is *indexSearch) getMetricIDsForTagFilterSlow(tf *tagFilter, filter *uint6
} }
// Slow path: need tf.matchSuffix call. // Slow path: need tf.matchSuffix call.
ok, err := tf.matchSuffix(suffix) ok, err := tf.matchSuffix(suffix)
loopsCount += reMatchCost loopsCount += tf.matchCost
if err != nil { if err != nil {
return loopsCount, fmt.Errorf("error when matching %s against suffix %q: %w", tf, suffix, err) return loopsCount, fmt.Errorf("error when matching %s against suffix %q: %w", tf, suffix, err)
} }