code: func (h *Handle) LoadNeededHistograms() error {
  	cols := statistics.HistogramNeededColumns.AllCols()
  	for _, col := range cols {
  		tbl, ok := h.StatsCache.Load().(StatsCache)[col.TableID]
  		if !ok {
  			continue
  		}
  		tbl = tbl.Copy()
  		c, ok := tbl.Columns[col.ColumnID]
  		if !ok || c.Len() > 0 {
  			statistics.HistogramNeededColumns.Delete(col)
  			continue
  		}
  		hg, err := h.histogramFromStorage(col.TableID, c.ID, &c.Info.FieldType, c.NDV, 0, c.LastUpdateVersion, c.NullCount, c.TotColSize, c.Correlation)
  		if err != nil {
  			return errors.Trace(err)
  		}
  		cms, err := h.cmSketchFromStorage(col.TableID, 0, col.ColumnID)
  		if err != nil {
  			return errors.Trace(err)
  		}
  		tbl.Columns[c.ID] = &statistics.Column{
  			PhysicalID: col.TableID,
  			Histogram:  *hg,
  			Info:       c.Info,
  			CMSketch:   cms,
  			Count:      int64(hg.TotalRowCount()),
  			IsHandle:   c.IsHandle,
  		}
  		h.UpdateTableStats([]*statistics.Table{tbl}, nil)
  		statistics.HistogramNeededColumns.Delete(col)
  	}
  	return nil
  }
docs: // LoadNeededHistograms will load histograms for those needed columns.