如何檢查特定 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 年 1 月 28 日

263 個瀏覽量

開啟你的 職業生涯

完成課程獲得認證

立即開始
廣告
© . All rights reserved.