diff --git a/pkg/statistics/table.go b/pkg/statistics/table.go index 804e115056c7b..81ca4ff7a692b 100644 --- a/pkg/statistics/table.go +++ b/pkg/statistics/table.go @@ -822,10 +822,13 @@ func (t *Table) ColumnIsLoadNeeded(id int64, fullLoad bool) (*Column, bool, bool // when we use non-lite init stats, it cannot init the stats for common columns. // so we need to force to load the stats. col, ok := t.columns[id] + hasAnalyzed := t.ColAndIdxExistenceMap.HasAnalyzed(id, false) if !ok { + if t.ColAndIdxExistenceMap.Checked() { + return nil, true, hasAnalyzed + } return nil, true, true } - hasAnalyzed := t.ColAndIdxExistenceMap.HasAnalyzed(id, false) // If it's not analyzed yet. // The real check condition: !ok && !hashAnalyzed.