2018년 8월 29일 수요일

table size and index size


SELECT
    TABLE_NAME,
    TABLE_ROWS,
    ROUND(DATA_LENGTH / (1024 * 1024), 2) AS `TABLE SIZE(MB)`,
    ROUND(INDEX_LENGTH / (1024 * 1024), 2) AS `INDEX SIZE(MB)`
FROM
    INFORMATION_SCHEMA.TABLES
WHERE
    TABLE_SCHEMA = 'DB_NAME'
GROUP BY TABLE_NAME
ORDER BY DATA_LENGTH DESC

댓글 없음:

댓글 쓰기