title: TABLE_STORAGE_STATS
summary: 了解 information_schema 表 TABLE_STORAGE_STATS。
TABLE_STORAGE_STATS
TABLE_STORAGE_STATS 表提供有关由存储引擎 (TiKV) 存储的表大小的信息。
USE information_schema;DESC table_storage_stats;
+--------------------+-------------+------+------+---------+-------+| Field | Type | Null | Key | Default | Extra |+--------------------+-------------+------+------+---------+-------+| TABLE_SCHEMA | varchar(64) | YES | | NULL | || TABLE_NAME | varchar(64) | YES | | NULL | || TABLE_ID | bigint(21) | YES | | NULL | || PEER_COUNT | bigint(21) | YES | | NULL | || REGION_COUNT | bigint(21) | YES | | NULL | || EMPTY_REGION_COUNT | bigint(21) | YES | | NULL | || TABLE_SIZE | bigint(64) | YES | | NULL | || TABLE_KEYS | bigint(64) | YES | | NULL | |+--------------------+-------------+------+------+---------+-------+8 rows in set (0.00 sec)
CREATE TABLE test.t1 (id INT);INSERT INTO test.t1 VALUES (1);SELECT * FROM table_storage_stats WHERE table_schema = 'test' AND table_name = 't1'\G
*************************** 1. row ***************************TABLE_SCHEMA: testTABLE_NAME: t1TABLE_ID: 56PEER_COUNT: 1REGION_COUNT: 1EMPTY_REGION_COUNT: 1TABLE_SIZE: 1TABLE_KEYS: 01 row in set (0.00 sec)