Skip to content

Commit

Permalink
statistics: remove useless code (#49206)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei authored Dec 28, 2023
1 parent 3f4db1a commit 36cafb2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pkg/statistics/handle/storage/stats_read_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ func (s *statsReadWriter) loadStatsFromJSON(tableInfo *model.TableInfo, physical
// loadStatsFromJSON doesn't support partition table now.
// The table level count and modify_count would be overridden by the SaveMetaToStorage below, so we don't need
// to care about them here.
err = s.SaveStatsToStorage(tbl.PhysicalID, tbl.RealtimeCount, 0, 0, &col.Histogram, col.CMSketch, col.TopN, int(col.GetStatsVer()), 1, false, util.StatsMetaHistorySourceLoadStats)
err = s.SaveStatsToStorage(tbl.PhysicalID, tbl.RealtimeCount, 0, 0, &col.Histogram, col.CMSketch, col.TopN, int(col.GetStatsVer()), statistics.AnalyzeFlag, false, util.StatsMetaHistorySourceLoadStats)
if err != nil {
return errors.Trace(err)
}
Expand All @@ -661,7 +661,7 @@ func (s *statsReadWriter) loadStatsFromJSON(tableInfo *model.TableInfo, physical
// loadStatsFromJSON doesn't support partition table now.
// The table level count and modify_count would be overridden by the SaveMetaToStorage below, so we don't need
// to care about them here.
err = s.SaveStatsToStorage(tbl.PhysicalID, tbl.RealtimeCount, 0, 1, &idx.Histogram, idx.CMSketch, idx.TopN, int(idx.GetStatsVer()), 1, false, util.StatsMetaHistorySourceLoadStats)
err = s.SaveStatsToStorage(tbl.PhysicalID, tbl.RealtimeCount, 0, 1, &idx.Histogram, idx.CMSketch, idx.TopN, int(idx.GetStatsVer()), statistics.AnalyzeFlag, false, util.StatsMetaHistorySourceLoadStats)
if err != nil {
return errors.Trace(err)
}
Expand Down
5 changes: 0 additions & 5 deletions pkg/statistics/histogram.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,6 @@ const (
// AnalyzeFlag is set when the statistics comes from analyze.
const AnalyzeFlag = 1

// IsAnalyzed checks whether this flag contains AnalyzeFlag.
func IsAnalyzed(flag int64) bool {
return (flag & AnalyzeFlag) > 0
}

// ValueToString converts a possible encoded value to a formatted string. If the value is encoded, then
// idxCols equals to number of origin values, else idxCols is 0.
func ValueToString(vars *variable.SessionVars, value *types.Datum, idxCols int, idxColumnTypes []byte) (string, error) {
Expand Down

0 comments on commit 36cafb2

Please sign in to comment.