From 6a5a5e714db76e1f594f97ab3b3e74d0948a9a47 Mon Sep 17 00:00:00 2001 From: Elsa <111482174+elsa0520@users.noreply.github.com> Date: Thu, 21 Dec 2023 01:06:22 +0800 Subject: [PATCH] statistics: add some key info in sync load timeout log (#49630) close pingcap/tidb#49631 --- pkg/statistics/column.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/statistics/column.go b/pkg/statistics/column.go index 5f2d38efdf011..507a72c2e04a3 100644 --- a/pkg/statistics/column.go +++ b/pkg/statistics/column.go @@ -15,8 +15,6 @@ package statistics import ( - "strconv" - "github.com/pingcap/tidb/pkg/parser/model" "github.com/pingcap/tidb/pkg/parser/mysql" "github.com/pingcap/tidb/pkg/planner/util/debugtrace" @@ -168,7 +166,9 @@ func (c *Column) IsInvalid( if (!c.IsStatsInitialized() || c.IsLoadNeeded()) && stmtctx != nil { if stmtctx.StatsLoad.Timeout > 0 { logutil.BgLogger().Warn("Hist for column should already be loaded as sync but not found.", - zap.String(strconv.FormatInt(c.Info.ID, 10), c.Info.Name.O)) + zap.Int64("table_id", c.PhysicalID), + zap.Int64("column_id", c.Info.ID), + zap.String("column_name", c.Info.Name.O)) } // In some tests, the c.Info is not set, so we add this check here. // When we are using stats from PseudoTable(), the table ID will possibly be -1.