Skip to content

Commit

Permalink
statistics: kill in time when to mergeGlobalTopN with partition (#45707
Browse files Browse the repository at this point in the history
…) (#45708)

close #45706
  • Loading branch information
ti-chi-bot authored Aug 1, 2023
1 parent 3fe36d8 commit 40cfe57
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions statistics/cmsketch.go
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,9 @@ func MergePartTopN2GlobalTopN(loc *time.Location, version int, topNs []*TopN, n
// 1. Check the topN first.
// 2. If the topN doesn't contain the value corresponding to encodedVal. We should check the histogram.
for j := 0; j < partNum; j++ {
if atomic.LoadUint32(kiiled) == 1 {
return nil, nil, nil, errors.Trace(ErrQueryInterrupted)
}
if (j == i && version >= 2) || topNs[j].findTopN(val.Encoded) != -1 {
continue
}
Expand Down

0 comments on commit 40cfe57

Please sign in to comment.