Addressed Goutham's review.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
This commit is contained in:
Bartlomiej Plotka 2020-03-13 19:18:31 +00:00
parent cd9516316a
commit 9d9c45588e

View file

@ -90,15 +90,15 @@ func (q *querier) Select(sortSeries bool, hints *storage.SelectHints, ms ...*lab
return storage.EmptySeriesSet(), nil, nil
}
if len(q.blocks) == 1 {
// Sorting Head series is slow, and unneeded when only the
// Head is being queried.
return q.blocks[0].Select(sortSeries, hints, ms...)
}
ss := make([]storage.SeriesSet, len(q.blocks))
var ws storage.Warnings
for i, b := range q.blocks {
// Sorting Head series is slow, and unneeded when only the
// Head is being queried. Sorting blocks is a noop.
// Still we have to sort if blocks > 1 as MergedSeriesSet requires it.
// We have to sort if blocks > 1 as MergedSeriesSet requires it.
s, w, err := b.Select(true, hints, ms...)
ws = append(ws, w...)
if err != nil {