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
close #45706
  • Loading branch information
hawkingrei authored Aug 1, 2023
1 parent c46da07 commit cf7ae4c
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 @@ -834,6 +834,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 cf7ae4c

Please sign in to comment.