統計_メタを表示

SHOW STATS_METAを使用して、テーブル内の行数と、そのテーブル内で変更された行数を表示できます。このステートメントを使用すると、必要な情報をShowLikeOrWhere句でフィルター処理できます。

現在、 SHOW STATS_METAステートメントは 6 列を出力します。

カラム名説明
データベース名データベース名
テーブル名テーブル名
パーティション名パーティション名
update_time最終更新時刻
変更回数変更された行数
行数合計行数

ノート:

TiDB が DML ステートメントに従ってmodify_countフィールドとrow_countフィールドを更新すると、 update_timeが更新されます。したがって、 update_timeANALYZEステートメントの最後の実行時間ではありません。

あらすじ

ShowStmt

ShowStmt

ShowTargetFiltertable

ShowTargetFilterable

ShowLikeOrWhereOpt

ShowLikeOrWhereOpt

show stats_meta;
+---------+------------+----------------+---------------------+--------------+-----------+ | Db_name | Table_name | Partition_name | Update_time | Modify_count | Row_count | +---------+------------+----------------+---------------------+--------------+-----------+ | test | t0 | | 2020-05-15 16:58:00 | 0 | 0 | | test | t1 | | 2020-05-15 16:58:04 | 0 | 0 | | test | t2 | | 2020-05-15 16:58:11 | 0 | 0 | | test | s | | 2020-05-22 19:46:43 | 0 | 0 | | test | t | | 2020-05-25 12:04:21 | 0 | 0 | +---------+------------+----------------+---------------------+--------------+-----------+ 5 rows in set (0.00 sec)
show stats_meta where table_name = 't2';
+---------+------------+----------------+---------------------+--------------+-----------+ | Db_name | Table_name | Partition_name | Update_time | Modify_count | Row_count | +---------+------------+----------------+---------------------+--------------+-----------+ | test | t2 | | 2020-05-15 16:58:11 | 0 | 0 | +---------+------------+----------------+---------------------+--------------+-----------+ 1 row in set (0.00 sec)

MySQL の互換性

このステートメントは、MySQL 構文に対する TiDB 拡張です。

こちらもご覧ください

このページは役に立ちましたか?

Playground
新規
登録なしで TiDB の機能をワンストップでインタラクティブに体験できます。
製品
TiDB Cloud
TiDB
価格
PoC お問い合わせ
エコシステム
TiKV
TiFlash
OSS Insight
© 2024 PingCAP. All Rights Reserved.
Privacy Policy.