code: func (q *QueryFeedback) Update(startKey kv.Key, counts []int64) {
  	// Older version do not have the counts info.
  	if len(counts) == 0 {
  		q.Invalidate()
  		return
  	}
  	sum := int64(0)
  	for _, count := range counts {
  		sum += count
  	}
  	metrics.DistSQLScanKeysPartialHistogram.Observe(float64(sum))
  	q.actual += sum
  	if !q.Valid || q.Hist == nil {
  		return
  	}
  
  	if q.Tp == IndexType {
  		startKey = tablecodec.CutIndexPrefix(startKey)
  	} else {
  		startKey = tablecodec.CutRowKeyPrefix(startKey)
  	}
  	// Find the range that startKey falls in.
  	idx := sort.Search(len(q.Feedback), func(i int) bool {
  		return bytes.Compare(q.Feedback[i].Lower.GetBytes(), startKey) > 0
  	})
  	idx--
  	if idx < 0 {
  		return
  	}
  	// If the desc is true, the counts is reversed, so here we need to reverse it back.
  	if q.desc {
  		for i := 0; i < len(counts)/2; i++ {
  			j := len(counts) - i - 1
  			counts[i], counts[j] = counts[j], counts[i]
  		}
  	}
  	// Update the feedback count info.
  	for i, count := range counts {
  		if i+idx >= len(q.Feedback) {
  			q.Invalidate()
  			break
  		}
  		q.Feedback[i+idx].Count += count
  	}
  	return
  }
docs: // Update updates the query feedback. `startKey` is the start scan key of the partial result, used to find
  // the range for update. `counts` is the scan counts of each range, used to update the feedback count info.