DROP STATS

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

Synopsis

DropStatsStmt

DROP STATS - 图1

TableNameList

DROP STATS - 图2

TableName

DROP STATS - 图3

  1. DropStatsStmt ::=
  2. 'DROP' 'STATS' TableNameList
  3. TableNameList ::=
  4. TableName ( ',' TableName )*
  5. TableName ::=
  6. Identifier ('.' Identifier)?

Examples

  1. CREATE TABLE t(a INT);
  1. Query OK, 0 rows affected (0.01 sec)
  1. SHOW STATS_META WHERE db_name='test' and table_name='t';
  1. +---------+------------+----------------+---------------------+--------------+-----------+
  2. | Db_name | Table_name | Partition_name | Update_time | Modify_count | Row_count |
  3. +---------+------------+----------------+---------------------+--------------+-----------+
  4. | test | t | | 2020-05-25 20:34:33 | 0 | 0 |
  5. +---------+------------+----------------+---------------------+--------------+-----------+
  6. 1 row in set (0.00 sec)
  1. DROP STATS t;
  1. Query OK, 0 rows affected (0.00 sec)
  1. SHOW STATS_META WHERE db_name='test' and table_name='t';
  1. Empty set (0.00 sec)

MySQL compatibility

This statement is a TiDB extension to MySQL syntax.

See also