티스토리 뷰

한번 참고해 볼만한 쿼리~~ :)

SELECT 

    table_name,

    table_rows,

    data_length,

    ROUND(data_length/table_rows) AS row_size,

    ROUND(data_length/(1024*1024),2) AS 'DATA_SIZE(MB)',

    ROUND(index_length/(1024*1024),2) AS 'INDEX_SIZE(MB)'

FROM information_schema.TABLES

WHERE table_schema = '데이터베이스 이름'

AND table_rows > 0

GROUP BY table_name 

ORDER BY data_length DESC;

댓글
댓글쓰기 폼