TiDBTiDB Docs Dash 2024

Jan 9 - Jan 12 (UTC)
Join us to improve docs and win a prize!
Sign InTry Free

DROP STATS

The DROP STATS statement is used to delete the statistics of the selected table from the selected database.

Synopsis

DropStatsStmt
DROPSTATSTableNameList
TableNameList
TableName,
TableName
Identifier.Identifier

Examples

CREATE TABLE t(a INT);
Query OK, 0 rows affected (0.01 sec)
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)
DROP STATS t;
Query OK, 0 rows affected (0.00 sec)
SHOW STATS_META WHERE db_name='test' and table_name='t';
Empty set (0.00 sec)

MySQL compatibility

This statement is a TiDB extension to MySQL syntax.

See also

Was this page helpful?

Download PDFRequest docs changesAsk questions on Discord
Playground
New
One-stop & interactive experience of TiDB's capabilities WITHOUT registration.
Products
TiDB
TiDB Dedicated
TiDB Serverless
Pricing
Get Demo
Get Started
© 2024 PingCAP. All Rights Reserved.
Privacy Policy.