pingcap / pingcap/tidb

planner: add memory usage of analyze command in the result of "show analyze status"

Open
#60,165 1 comment 0 reactions 2 assignees Claimed by @winoros View on GitHub
component/statistics sig/planner type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement
As the title say, now the result of "show analyze status" doesn't show the amount of memory it used, we'd better add this info into the result, which can help us investigate OOM or high-memory issues:
```
+--------------+------------+----------------+--------------------------------------------------------------------+----------------+---------------------+---------------------+----------+-------------+---------------------+------------+
| Table_schema | Table_name | Partition_name | Job_info | Processed_rows | Start_time | End_time | State | Fail_reason | Instance | Process_ID |
+--------------+------------+----------------+--------------------------------------------------------------------+----------------+---------------------+---------------------+----------+-------------+---------------------+------------+
| test | t | | analyze table all columns with 256 buckets, 500 topn, 1 samplerate | 1 | 2025-03-19 14:52:03 | 2025-03-19 14:52:03 | finished | NULL | 192.168.31.222:4000 | NULL |
+--------------+------------+----------------+--------------------------------------------------------------------+----------------+---------------------+---------------------+----------+-------------+---------------------+------------+
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.