From 9a90e6027c08a3bfd176046765ea7506fd35b395 Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Fri, 31 Oct 2025 14:29:28 +0800 Subject: [PATCH 1/5] add Last_analyze_time for show stats_meta Signed-off-by: Weizhen Wang --- sql-statements/sql-statement-show-stats-meta.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sql-statements/sql-statement-show-stats-meta.md b/sql-statements/sql-statement-show-stats-meta.md index af102b4d3d99a..0df158f61df24 100644 --- a/sql-statements/sql-statement-show-stats-meta.md +++ b/sql-statements/sql-statement-show-stats-meta.md @@ -17,6 +17,7 @@ Currently, the `SHOW STATS_META` statement outputs 6 columns: | update_time | Last updated time | | modify_count | The number of rows modified | | row_count | The total row count | +| Last_analyze_time | The last time when the table was analyzed | > **Note:** > From 0625ee2c1061755a9d4828199e7aaee8b4cf6b89 Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Fri, 31 Oct 2025 16:23:39 +0800 Subject: [PATCH 2/5] Update sql-statements/sql-statement-show-stats-meta.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- sql-statements/sql-statement-show-stats-meta.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-show-stats-meta.md b/sql-statements/sql-statement-show-stats-meta.md index 0df158f61df24..81c1b523b8c3e 100644 --- a/sql-statements/sql-statement-show-stats-meta.md +++ b/sql-statements/sql-statement-show-stats-meta.md @@ -17,7 +17,7 @@ Currently, the `SHOW STATS_META` statement outputs 6 columns: | update_time | Last updated time | | modify_count | The number of rows modified | | row_count | The total row count | -| Last_analyze_time | The last time when the table was analyzed | +| last_analyze_time | The last time the table is analyzed | > **Note:** > From f83b05912e08af4a89c7bceb684ea4dfa089829a Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Fri, 31 Oct 2025 16:29:04 +0800 Subject: [PATCH 3/5] Update sql-statement-show-stats-meta.md --- sql-statements/sql-statement-show-stats-meta.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-show-stats-meta.md b/sql-statements/sql-statement-show-stats-meta.md index 81c1b523b8c3e..50d492af19d56 100644 --- a/sql-statements/sql-statement-show-stats-meta.md +++ b/sql-statements/sql-statement-show-stats-meta.md @@ -7,7 +7,7 @@ summary: An overview of the usage of SHOW STATS_META for TiDB database. You can use `SHOW STATS_META` to view how many rows are in a table and how many rows are changed in that table. When using this statement, you can filter the needed information by the `ShowLikeOrWhere` clause. -Currently, the `SHOW STATS_META` statement outputs 6 columns: +Currently, the `SHOW STATS_META` statement outputs the following columns: | Column name | Description | | -------- | ------------- | From 076a47bc02c14b92f80f23c88cad78a1fad14878 Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Fri, 31 Oct 2025 16:40:21 +0800 Subject: [PATCH 4/5] Correct column name casing in SHOW STATS_META doc Updated column names in the SHOW STATS_META documentation to use proper casing. --- sql-statements/sql-statement-show-stats-meta.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sql-statements/sql-statement-show-stats-meta.md b/sql-statements/sql-statement-show-stats-meta.md index 50d492af19d56..32f2bbcb1b9c1 100644 --- a/sql-statements/sql-statement-show-stats-meta.md +++ b/sql-statements/sql-statement-show-stats-meta.md @@ -11,13 +11,13 @@ Currently, the `SHOW STATS_META` statement outputs the following columns: | Column name | Description | | -------- | ------------- | -| db_name | Database name | -| table_name | Table name | -| partition_name| Partition name | -| update_time | Last updated time | -| modify_count | The number of rows modified | -| row_count | The total row count | -| last_analyze_time | The last time the table is analyzed | +| Db_name | Database name | +| Table_name | Table name | +| Partition_name| Partition name | +| Update_time | Last updated time | +| Modify_count | The number of rows modified | +| Row_count | The total row count | +| Last_analyze_time | The last time the table is analyzed | > **Note:** > From ba6930a9e24dfc2a8afd0f88e88493752eb140b9 Mon Sep 17 00:00:00 2001 From: houfaxin Date: Fri, 7 Nov 2025 15:57:29 +0800 Subject: [PATCH 5/5] Update sql-statement-show-stats-meta.md --- .../sql-statement-show-stats-meta.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/sql-statements/sql-statement-show-stats-meta.md b/sql-statements/sql-statement-show-stats-meta.md index 32f2bbcb1b9c1..a5205d3b5b6d0 100644 --- a/sql-statements/sql-statement-show-stats-meta.md +++ b/sql-statements/sql-statement-show-stats-meta.md @@ -41,15 +41,15 @@ SHOW STATS_META; ``` ```sql -+---------+------------+----------------+---------------------+--------------+-----------+ -| Db_name | Table_name | Partition_name | Update_time | Modify_count | Row_count | -+---------+------------+----------------+---------------------+--------------+-----------+ -| test | t0 | | 2020-05-15 16:58:00 | 0 | 0 | -| test | t1 | | 2020-05-15 16:58:04 | 0 | 0 | -| test | t2 | | 2020-05-15 16:58:11 | 0 | 0 | -| test | s | | 2020-05-22 19:46:43 | 0 | 0 | -| test | t | | 2020-05-25 12:04:21 | 0 | 0 | -+---------+------------+----------------+---------------------+--------------+-----------+ ++---------+------------+----------------+---------------------+--------------+-----------+---------------------+ +| Db_name | Table_name | Partition_name | Update_time | Modify_count | Row_count | Last_analyze_time | ++---------+------------+----------------+---------------------+--------------+-----------+---------------------+ +| test | t0 | | 2025-07-27 16:58:00 | 0 | 0 | 2025-07-27 16:58:00 | +| test | t1 | | 2025-07-27 16:58:04 | 0 | 0 | 2025-07-27 16:58:04 | +| test | t2 | | 2025-07-27 16:58:11 | 0 | 0 | 2025-07-27 16:58:11 | +| test | s | | 2025-07-27 19:46:43 | 0 | 0 | 2025-07-27 19:46:43 | +| test | t | | 2025-07-27 12:04:21 | 0 | 0 | 2025-07-27 12:04:21 | ++---------+------------+----------------+---------------------+--------------+-----------+---------------------+ 5 rows in set (0.00 sec) ``` @@ -58,11 +58,11 @@ SHOW STATS_META WHERE table_name = 't2'; ``` ```sql -+---------+------------+----------------+---------------------+--------------+-----------+ -| Db_name | Table_name | Partition_name | Update_time | Modify_count | Row_count | -+---------+------------+----------------+---------------------+--------------+-----------+ -| test | t2 | | 2020-05-15 16:58:11 | 0 | 0 | -+---------+------------+----------------+---------------------+--------------+-----------+ ++---------+------------+----------------+---------------------+--------------+-----------+---------------------+ +| Db_name | Table_name | Partition_name | Update_time | Modify_count | Row_count | Last_analyze_time | ++---------+------------+----------------+---------------------+--------------+-----------+---------------------+ +| test | t2 | | 2025-07-27 16:58:11 | 0 | 0 | 2025-07-27 16:58:11 | ++---------+------------+----------------+---------------------+--------------+-----------+---------------------+ 1 row in set (0.00 sec) ```