code: func (h *Handle) HandleAutoAnalyze(is infoschema.InfoSchema) {
  	dbs := is.AllSchemaNames()
  	parameters := h.getAutoAnalyzeParameters()
  	autoAnalyzeRatio := parseAutoAnalyzeRatio(parameters[variable.TiDBAutoAnalyzeRatio])
  	start, end, err := parseAnalyzePeriod(parameters[variable.TiDBAutoAnalyzeStartTime], parameters[variable.TiDBAutoAnalyzeEndTime])
  	if err != nil {
  		logutil.Logger(context.Background()).Error("[stats] parse auto analyze period failed", zap.Error(err))
  		return
  	}
  	for _, db := range dbs {
  		tbls := is.SchemaTables(model.NewCIStr(db))
  		for _, tbl := range tbls {
  			tblInfo := tbl.Meta()
  			pi := tblInfo.GetPartitionInfo()
  			tblName := "`" + db + "`.`" + tblInfo.Name.O + "`"
  			if pi == nil {
  				statsTbl := h.GetTableStats(tblInfo)
  				sql := fmt.Sprintf("analyze table %s", tblName)
  				analyzed := h.autoAnalyzeTable(tblInfo, statsTbl, start, end, autoAnalyzeRatio, sql)
  				if analyzed {
  					return
  				}
  				continue
  			}
  			for _, def := range pi.Definitions {
  				sql := fmt.Sprintf("analyze table %s partition `%s`", tblName, def.Name.O)
  				statsTbl := h.GetPartitionStats(tblInfo, def.ID)
  				analyzed := h.autoAnalyzeTable(tblInfo, statsTbl, start, end, autoAnalyzeRatio, sql)
  				if analyzed {
  					return
  				}
  				continue
  			}
  		}
  	}
  	return
  }
docs: // HandleAutoAnalyze analyzes the newly created table or index.