round((data_length+index_length)/1024/1024),2)asSIZE  ->FROMinformation_schema.TAB"/> round((data_length+index_length)/1024/1024),2)asSIZE  ->FROMinformation_schema.TAB">

首頁  >  文章  >  資料庫  >  如何檢查特定 MySQL 資料庫中表格的大小?

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

王林
王林轉載
2023-09-02 15:09:04661瀏覽

如何检查特定 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)

這裡的輸出給出了範例資料庫中三個表的大小。

以上是如何檢查特定 MySQL 資料庫中表格的大小?的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:tutorialspoint.com。如有侵權,請聯絡admin@php.cn刪除