본문 바로가기

MySQL

DB 테이블별 용량 확인 쿼리

SELECT 
          TABLE_NAME AS "tables",
          Round(((data_length + index_length) / 1024 / 1024), 2) "MB"
FROM 

          information_schema.TABLES
WHERE 

          table_schema = "onm"
ORDER BY (data_length + index_length) DESC;