mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-30 15:22:07 +00:00
lib/storage: skip duplicate call to intersectMetricIDsWithTagFilter on zero successful intersects
This commit is contained in:
parent
51a21c7d4b
commit
3a697a935a
1 changed files with 5 additions and 0 deletions
|
@ -1561,6 +1561,7 @@ func (is *indexSearch) updateMetricIDsForTagFilters(metricIDs map[uint64]struct{
|
||||||
|
|
||||||
// Find intersection of minTf with other tfs.
|
// Find intersection of minTf with other tfs.
|
||||||
var tfsPostponed []*tagFilter
|
var tfsPostponed []*tagFilter
|
||||||
|
successfulIntersects := 0
|
||||||
for i := range tfs.tfs {
|
for i := range tfs.tfs {
|
||||||
tf := &tfs.tfs[i]
|
tf := &tfs.tfs[i]
|
||||||
if tf == minTf {
|
if tf == minTf {
|
||||||
|
@ -1577,6 +1578,10 @@ func (is *indexSearch) updateMetricIDsForTagFilters(metricIDs map[uint64]struct{
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
minMetricIDs = mIDs
|
minMetricIDs = mIDs
|
||||||
|
successfulIntersects++
|
||||||
|
}
|
||||||
|
if len(tfsPostponed) > 0 && successfulIntersects == 0 {
|
||||||
|
return is.updateMetricIDsByMetricNameMatch(metricIDs, minMetricIDs, tfsPostponed)
|
||||||
}
|
}
|
||||||
for i, tf := range tfsPostponed {
|
for i, tf := range tfsPostponed {
|
||||||
mIDs, err := is.intersectMetricIDsWithTagFilter(tf, minMetricIDs)
|
mIDs, err := is.intersectMetricIDsWithTagFilter(tf, minMetricIDs)
|
||||||
|
|
Loading…
Reference in a new issue