第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何獲取MySQL數(shù)據(jù)庫表的大小?

如何獲取MySQL數(shù)據(jù)庫表的大?。?/h1>
子衿沉夜 2019-09-06 17:13:09
我可以運行此查詢來獲取MySQL數(shù)據(jù)庫中所有表的大?。簊how table status from myDatabaseName;我想在理解結果方面提供一些幫助。我正在尋找最大尺寸的桌子。我應該看哪一欄?
查看完整描述

3 回答

?
一只萌萌小番薯

TA貢獻1795條經(jīng)驗 獲得超7個贊

您可以使用此查詢來顯示表的大?。ūM管您需要先替換變量):


SELECT 

    table_name AS `Table`, 

    round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` 

FROM information_schema.TABLES 

WHERE table_schema = "$DB_NAME"

    AND table_name = "$TABLE_NAME";

或者此查詢列出每個數(shù)據(jù)庫中每個表的大小,最大的第一個:


SELECT 

     table_schema as `Database`, 

     table_name AS `Table`, 

     round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` 

FROM information_schema.TABLES 

ORDER BY (data_length + index_length) DESC;


查看完整回答
反對 回復 2019-09-06
?
至尊寶的傳說

TA貢獻1789條經(jīng)驗 獲得超10個贊

SELECT TABLE_NAME AS "Table Name", 

table_rows AS "Quant of Rows", ROUND( (

data_length + index_length

) /1024, 2 ) AS "Total Size Kb"

FROM information_schema.TABLES

WHERE information_schema.TABLES.table_schema = 'YOUR SCHEMA NAME/DATABASE NAME HERE'

LIMIT 0 , 30

您可以從“ information_schema ” - > SCHEMATA表 - >“ SCHEMA_NAME ”列中獲取模式名稱


附加 您可以獲得如下的mysql數(shù)據(jù)庫大小。


SELECT table_schema "DB Name", 

Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" 

FROM   information_schema.tables 

GROUP  BY table_schema; 

結果


DB Name              |      DB Size in MB


mydatabase_wrdp             39.1

information_schema          0.0


查看完整回答
反對 回復 2019-09-06
?
臨摹微笑

TA貢獻1982條經(jīng)驗 獲得超2個贊

SELECT 

    table_name AS "Table",  

    round(((data_length + index_length) / 1024 / 1024), 2) as size   

FROM information_schema.TABLES  

WHERE table_schema = "YOUR_DATABASE_NAME"  

ORDER BY size DESC; 

這會對大小進行排序(DB大小,以MB為單位)。


查看完整回答
反對 回復 2019-09-06
  • 3 回答
  • 0 關注
  • 574 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號