这个查表大小也不准确呀
SELECT
db_name,
table_name,
ROUND(SUM(total_size / cnt), 2)/1024 Approximate_Size,
ROUND(SUM(total_size / cnt / (SELECT
ROUND(AVG(value), 2)
FROM
METRICS_SCHEMA.store_size_amplification
WHERE
value > 0)),
2)/1024 Disk_Size
FROM
(SELECT
db_name,
table_name,
region_id,
SUM(Approximate_Size) total_size,
COUNT(*) cnt
FROM
information_schema.TIKV_REGION_STATUS
WHERE
db_name = ‘db_name’
– AND table_name IN (‘t_name’)
GROUP BY db_name , table_name , region_id) tabinfo
GROUP BY db_name , table_name;
这个查完,磁盘总空间大小对不上