From 3891dc3eb65458bfc9a7bf86d11a4f11ef0906cc Mon Sep 17 00:00:00 2001 From: doc-claw-bot Date: Tue, 18 Aug 2026 15:16:10 +0000 Subject: [PATCH] docs: fix DROP STATS stats_meta example --- sql-statements/sql-statement-drop-stats.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-drop-stats.md b/sql-statements/sql-statement-drop-stats.md index c397505650fe..659784fd8bcc 100644 --- a/sql-statements/sql-statement-drop-stats.md +++ b/sql-statements/sql-statement-drop-stats.md @@ -81,12 +81,21 @@ DROP STATS t; Query OK, 0 rows affected (0.00 sec) ``` +执行 `DROP STATS` 后,`SHOW STATS_META` 仍会返回该表的行数和修改计数。 +`DROP STATS` 会清除 TopN、bucket 等直方图相关统计信息,但不会删除 +`STATS_META` 中对应的记录。 + ```sql SHOW STATS_META WHERE db_name='test' and table_name='t'; ``` ``` -Empty set (0.00 sec) ++---------+------------+----------------+---------------------+--------------+-----------+ +| Db_name | Table_name | Partition_name | Update_time | Modify_count | Row_count | ++---------+------------+----------------+---------------------+--------------+-----------+ +| test | t | | 2020-05-25 20:34:33 | 0 | 0 | ++---------+------------+----------------+---------------------+--------------+-----------+ +1 row in set (0.00 sec) ``` ## MySQL 兼容性