From 296b1721c4a133afe476dd185d0e4492e264caf7 Mon Sep 17 00:00:00 2001 From: Yiding Date: Thu, 28 Nov 2024 20:16:31 +0800 Subject: [PATCH] statistics: try to eliminate the unnecessary log for sync load --- pkg/statistics/table.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/statistics/table.go b/pkg/statistics/table.go index 804e115056c7bf..81ca4ff7a692bb 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.