diff --git a/util/execdetails.go b/util/execdetails.go index 2fd0584368..b3c377cec8 100644 --- a/util/execdetails.go +++ b/util/execdetails.go @@ -668,8 +668,10 @@ func (td *TimeDetail) String() string { buf.WriteString("tikv_wall_time: ") buf.WriteString(FormatDuration(td.TotalRPCWallTime)) } - buf.WriteString("}") - return buf.String() + if buf.Len() == 0 { + return "" + } + return "time_detail: {" + buf.String() + "}" } // Merge merges the time detail into itself.