如何檢查指定 MySQL 資料庫中的表大小?


我們已經檢查了 MySQL 資料庫的大小,同樣我們也可以檢查指定資料庫中表的大小。具體做法如下 −

mysql> SELECT
    -> table_name AS "Table",
    -> round(((data_length + index_length) / 1024 / 1024), 2) as SIZE
    -> FROM information_schema.TABLES
    -> WHERE table_schema = "SAMPLE"
    -> ORDER BY SIZE;
+-------------+-------+
| Table       | SIZE  |
+-------------+-------+
| employee    | 0.02  |
| student     | 0.02  |
| new_student | 0.02  |
+-------------+-------+
3 rows in set (0.00 sec)

此輸出給出了Sample 資料庫中三張表的大小。

更新於: 2020-01-28

263 次瀏覽

開啟你的 職業生涯

完成課程取證並獲得認證

開始學習
廣告
© . All rights reserved.