How can you determine how much disk space a particular MySQL table is taking up?

前端 未结 8 517
死守一世寂寞
死守一世寂寞 2020-11-30 16:20

Is there a quick way to determine how much disk space a particular MySQL table is taking up? The table may be MyISAM or Innodb.

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 17:09

    Based on the RolandMySQLDBA's answer I think we can use the above to get the size of each schema in a table:

    SELECT table_schema, SUM((data_length+index_length)/power(1024,1)) tablesize_kb 
        FROM information_schema.tables GROUP BY table_schema;
    

    Really liked it!

提交回复
热议问题