Skip to content

Latest commit

 

History

History
70 lines (48 loc) · 1.31 KB

sql-statement-drop-stats.md

File metadata and controls

70 lines (48 loc) · 1.31 KB
title summary category
DROP STATS
TiDB 数据库中 DROP STATS 的使用概况。
reference

DROP STATS

DROP STATS 语句用于从当前所选定的数据库中删除选定表的统计信息。

语法图

DropStatsStmt:

DropTableStmt

TableName:

TableName

示例

{{< copyable "sql" >}}

CREATE TABLE t(a INT);
Query OK, 0 rows affected (0.01 sec)

{{< copyable "sql" >}}

SHOW STATS_META WHERE db_name='test' and table_name='t';
+---------+------------+----------------+---------------------+--------------+-----------+
| 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)

{{< copyable "sql" >}}

DROP STATS t;
Query OK, 0 rows affected (0.00 sec)

{{< copyable "sql" >}}

SHOW STATS_META WHERE db_name='test' and table_name='t';
Empty set (0.00 sec)

另请参阅