Skip to content

Commit

Permalink
statistics: kill in time when to mergeGlobalTopN with partition
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
  • Loading branch information
hawkingrei committed Aug 1, 2023
1 parent 0e068ed commit 51b8eec
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 51b8eec

Please sign in to comment.