Skip to content

Commit

Permalink
only do it when series max size available
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <[email protected]>
  • Loading branch information
yeya24 committed Jun 22, 2023
1 parent bee0ccb commit 9e4d533
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/store/lazy_postings.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ func fetchLazyExpandedPostings(
var matchers []*labels.Matcher
keysToFetch := keys
// If all postings added, we always download all postings and then intersect.
if lazyExpandedPostingEnabled && !addAllPostings && len(postingGroups) > 1 {
// If there is no series max size in meta.json file, skip estimation.
if lazyExpandedPostingEnabled && !addAllPostings &&
r.block.meta.Thanos.IndexStats.SeriesMaxSize > 0 && len(postingGroups) > 1 {
var totalCardinality int64
minCardinality := int64(math.MaxInt64)
minGroupIdx := -1
Expand Down

0 comments on commit 9e4d533

Please sign in to comment.