code: func NewHandle(ctx sessionctx.Context, lease time.Duration) *Handle {
  	handle := &Handle{
  		ddlEventCh: make(chan *util.Event, 100),
  		listHead:   &SessionStatsCollector{mapper: make(tableDeltaMap), rateMap: make(errorRateDeltaMap)},
  		globalMap:  make(tableDeltaMap),
  		Lease:      lease,
  		feedback:   make([]*statistics.QueryFeedback, 0, MaxQueryFeedbackCount.Load()),
  	}
  	// It is safe to use it concurrently because the exec won't touch the ctx.
  	if exec, ok := ctx.(sqlexec.RestrictedSQLExecutor); ok {
  		handle.restrictedExec = exec
  	}
  	handle.mu.ctx = ctx
  	handle.mu.rateMap = make(errorRateDeltaMap)
  	handle.StatsCache.Store(StatsCache{})
  	return handle
  }
docs: // NewHandle creates a Handle for update stats.