diff --git a/lib/storage/index_db.go b/lib/storage/index_db.go index 8192dfef6f..5f54442bcf 100644 --- a/lib/storage/index_db.go +++ b/lib/storage/index_db.go @@ -1001,8 +1001,9 @@ func (is *indexSearch) getStartDateForPerDayInvertedIndex() (uint64, error) { if err := ts.Error(); err != nil { return 0, err } - // The database is empty. Return the current date. - return minDate, nil + // There are no (date,tag)->metricIDs entries in the database yet. + // Return the next date, since the current date may contain unindexed data. + return minDate + 1, nil } func (is *indexSearch) loadDeletedMetricIDs() (*uint64set.Set, error) {