[mysql] MySql DB/테이블 사이즈 확인을 위한 쿼리
1. 테이블별 사이즈 확인 (쿼리 시점에 정확한 사이즈는 아니지만, 참고할 만한 데이터임)
SELECT
table_name,
table_rows,
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 = '데이터베이스이름'
GROUP BY table_name
ORDER BY data_length DESC
LIMIT 10;
2. Database 별 사이즈 확인 (쿼리 시점에 정확한 사이즈는 아니지만, 참고할 만한 데이터임)
SELECT
count(*) NUM_OF_TABLE,
table_schema,concat(round(sum(table_rows)/1000000,2),'M') rows,
concat(round(sum(data_length)/(1024*1024*1024),2),'G') DATA,
concat(round(sum(index_length)/(1024*1024*1024),2),'G') idx,
concat(round(sum(data_length+index_length)/(1024*1024*1024),2),'G') total_size,
round(sum(index_length)/sum(data_length),2) idxfrac
FROM information_schema.TABLES
GROUP BY table_schema
ORDER BY sum(data_length+index_length) DESC LIMIT 10;
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
35 | PPT | [android] XML파서(XMLParser)의 종류와 성능 비교에 대한 발표 자료 | hooni | 2013.04.23 | 75631 |
34 | PPT | [Android] 제스처 자료.. | hooni | 2013.05.28 | 51067 |
33 | PPT | [android][ios] 알림(Notification) 기능에 대한 원리와 구현 방안 (APNS포함) | hooni | 2013.04.23 | 37847 |
32 | PPT | [ppt] Equation Solving 발표 자료 (@PWE랩 톡데이 2011.07.26) | hooni | 2013.04.23 | 24665 |
31 | PPT | [ppt] 뚜레쥬르 온라인 마케팅 제안서 | hooni | 2013.04.23 | 23481 |
30 | PPT | [doc] 정보보호이론 강의자료 (중앙대꺼..) 2 | hooni | 2013.04.23 | 22803 |
29 | PPT | [ajax] 크로스 도메인(Cross Domain) 이슈 해결 방안 | hooni | 2013.04.23 | 21931 |
28 | PPT | [doc] 발표 자료 ㅎㅎtalk4neo | hooni | 2013.04.23 | 20983 |
27 | PPT | [ppt] 시스템보안 연구실 ppt 템플릿.. (CIST) | hooni | 2013.04.23 | 20853 |
26 | PPT | [doc] 인공지능 관련 자료(채팅로봇도 포함..) | hooni | 2013.04.23 | 17996 |
25 | PPT | [php] 프레임워크 발표자료 및 샘플 구현 소스 | hooni | 2013.04.23 | 17490 |
24 | PPT | [doc] 논문.. VoIP 관련.. ㅋㅋ | hooni | 2013.04.23 | 17066 |