Skip to content

Commit d9ce6bd

Browse files
authored
sql: add Last_analyze_time column for SHOW STATS_META (#21991)
1 parent cb32f1c commit d9ce6bd

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

sql-statements/sql-statement-show-stats-meta.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ aliases: ['/docs/dev/sql-statements/sql-statement-show-stats-meta/']
88

99
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.
1010

11-
Currently, the `SHOW STATS_META` statement outputs 6 columns:
11+
Currently, the `SHOW STATS_META` statement outputs the following columns:
1212

1313
| Column name | Description |
1414
| -------- | ------------- |
15-
| db_name | Database name |
16-
| table_name | Table name |
17-
| partition_name| Partition name |
18-
| update_time | Last updated time |
19-
| modify_count | The number of rows modified |
20-
| row_count | The total row count |
15+
| Db_name | Database name |
16+
| Table_name | Table name |
17+
| Partition_name| Partition name |
18+
| Update_time | Last updated time |
19+
| Modify_count | The number of rows modified |
20+
| Row_count | The total row count |
21+
| Last_analyze_time | The last time the table is analyzed |
2122

2223
> **Note:**
2324
>
@@ -41,15 +42,15 @@ SHOW STATS_META;
4142
```
4243

4344
```sql
44-
+---------+------------+----------------+---------------------+--------------+-----------+
45-
| Db_name | Table_name | Partition_name | Update_time | Modify_count | Row_count |
46-
+---------+------------+----------------+---------------------+--------------+-----------+
47-
| test | t0 | | 2020-05-15 16:58:00 | 0 | 0 |
48-
| test | t1 | | 2020-05-15 16:58:04 | 0 | 0 |
49-
| test | t2 | | 2020-05-15 16:58:11 | 0 | 0 |
50-
| test | s | | 2020-05-22 19:46:43 | 0 | 0 |
51-
| test | t | | 2020-05-25 12:04:21 | 0 | 0 |
52-
+---------+------------+----------------+---------------------+--------------+-----------+
45+
+---------+------------+----------------+---------------------+--------------+-----------+---------------------+
46+
| Db_name | Table_name | Partition_name | Update_time | Modify_count | Row_count | Last_analyze_time |
47+
+---------+------------+----------------+---------------------+--------------+-----------+---------------------+
48+
| test | t0 | | 2025-07-27 16:58:00 | 0 | 0 | 2025-07-27 16:58:00 |
49+
| test | t1 | | 2025-07-27 16:58:04 | 0 | 0 | 2025-07-27 16:58:04 |
50+
| test | t2 | | 2025-07-27 16:58:11 | 0 | 0 | 2025-07-27 16:58:11 |
51+
| test | s | | 2025-07-27 19:46:43 | 0 | 0 | 2025-07-27 19:46:43 |
52+
| test | t | | 2025-07-27 12:04:21 | 0 | 0 | 2025-07-27 12:04:21 |
53+
+---------+------------+----------------+---------------------+--------------+-----------+---------------------+
5354
5 rows in set (0.00 sec)
5455
```
5556

@@ -58,11 +59,11 @@ SHOW STATS_META WHERE table_name = 't2';
5859
```
5960

6061
```sql
61-
+---------+------------+----------------+---------------------+--------------+-----------+
62-
| Db_name | Table_name | Partition_name | Update_time | Modify_count | Row_count |
63-
+---------+------------+----------------+---------------------+--------------+-----------+
64-
| test | t2 | | 2020-05-15 16:58:11 | 0 | 0 |
65-
+---------+------------+----------------+---------------------+--------------+-----------+
62+
+---------+------------+----------------+---------------------+--------------+-----------+---------------------+
63+
| Db_name | Table_name | Partition_name | Update_time | Modify_count | Row_count | Last_analyze_time |
64+
+---------+------------+----------------+---------------------+--------------+-----------+---------------------+
65+
| test | t2 | | 2025-07-27 16:58:11 | 0 | 0 | 2025-07-27 16:58:11 |
66+
+---------+------------+----------------+---------------------+--------------+-----------+---------------------+
6667
1 row in set (0.00 sec)
6768
```
6869

0 commit comments

Comments
 (0)