select count(*) from t1;
+----------+
| count(*) |
+----------+
| 5 |
+----------+
SELECT table_name,
data_length/1024/1024 AS 'data_length(MB)',
index_length/1024/1024 AS 'index_length(MB)',
(data_length + index_length)/1024/1024 AS 'total(MB)'
FROM information_schema.tables
WHERE table_schema='test'
AND table_name = 't1';
+------------+-----------------+------------------+------------+
| table_name | data_length(MB) | index_length(MB) | total(MB) |
+------------+-----------------+------------------+------------+
| t1 0.01562500 | 0.00000000 | 0.01562500 |
+------------+-----------------+------------------+------------+
从上面可以看出在磁盘上的数据大小是12G,而实际的大小才0.01562500MB(估计值),在种情况使用逻辑迁移是再好不过的了。
防止伪大表出现。
本文转自yzy121403725 51CTO博客,原文链接:http://blog.51cto.com/lookingdream/1906244,如需转载请自行联系原作者