code: func (do *Domain) UpdateTableStatsLoop(ctx sessionctx.Context) error {
  	ctx.GetSessionVars().InRestrictedSQL = true
  	statsHandle := handle.NewHandle(ctx, do.statsLease)
  	atomic.StorePointer(&do.statsHandle, unsafe.Pointer(statsHandle))
  	do.ddl.RegisterEventCh(statsHandle.DDLEventCh())
  	if do.statsLease <= 0 {
  		return nil
  	}
  	owner := do.newStatsOwner()
  	do.wg.Add(1)
  	do.SetStatsUpdating(true)
  	go do.updateStatsWorker(ctx, owner)
  	if RunAutoAnalyze {
  		do.wg.Add(1)
  		go do.autoAnalyzeWorker(owner)
  	}
  	return nil
  }
docs: // UpdateTableStatsLoop creates a goroutine loads stats info and updates stats info in a loop.
  // It will also start a goroutine to analyze tables automatically.
  // It should be called only once in BootstrapSession.