MySQL 데이터 용량확인 – 테이블, 데이터베이스

테이블 용량확인

SELECT
concat(table_schema,'.',{TABLE_NAME}),
concat(round(table_rows/1000000,2),'M') rows,
concat(round(data_length/(1024*1024*1024),2),'G') DATA,
concat(round(index_length/(1024*1024*1024),2),'G') idx,
concat(round((data_length+index_length)/(1024*1024*1024),2),'G') total_size,
round(index_length/data_length,2) idxfrac
FROM information_schema.TABLES
where table_name = 'dfs_data' ;

데이터베이스 용량확인

SELECT table_schema "{DATABASE_NAME}",
SUM(data_length + index_length) / 1024 / 1024 "Size(MB)"
FROM information_schema.TABLES
GROUP BY table_schema;

 

어디서 퍼왔는지는 까먹음

Leave a Reply

Your email address will not be published. Required fields are marked *

 characters available