lib/storage: optimize /api/v1/status/tsdb call by skipping all the artificially created tag entries at once

This is a follow-up for b71be42d90
This commit is contained in:
Aliaksandr Valialkin 2022-02-21 18:20:36 +02:00
parent ed12c60826
commit f72b35665f
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -1400,6 +1400,14 @@ func (is *indexSearch) getTSDBStatusWithFiltersForDate(tfss []*TagFilters, date
}
if isArtificialTagKey(tmp) {
// Skip artificially created tag keys.
kb.B = append(kb.B[:0], prefix...)
if len(tmp) > 0 && tmp[0] == compositeTagKeyPrefix {
kb.B = append(kb.B, compositeTagKeyPrefix)
} else {
kb.B = marshalTagValue(kb.B, tmp)
}
kb.B[len(kb.B)-1]++
ts.Seek(kb.B)
continue
}
if len(tmp) == 0 {