[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;
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
273 | Algorithm | Polynomial time 이란? ㅋㅋ | hooni | 2013.04.23 | 22753 |
272 | Database | [mysql] 루트 암호 초기화 | hooni | 2013.04.23 | 11104 |
271 | System/OS | [owasp] 10대 웹어플리케이션 보안 취약 | hooni | 2013.04.23 | 15972 |
270 | System/OS | 라우팅 경로 결정 영향 요소 ㅋㅋ | hooni | 2013.04.23 | 15898 |
269 | System/OS | OSI (Open Systems Interconnection) 개방형 시스템간 상호 접속 | hooni | 2013.04.23 | 10824 |
268 | System/OS | 네트워크별 MTU(최대 전송 단위) | hooni | 2013.04.23 | 17690 |
267 | System/OS | [router] 라우팅 프로토콜 BGP (간단한 세팅) | hooni | 2013.04.23 | 10996 |
266 | Algorithm | [security] 블럭 암호에 대해서.. | hooni | 2013.04.23 | 17169 |
265 | System/OS | [router] 시스코 라우터 명령어 모드.. | hooni | 2013.04.23 | 12992 |
264 | Develop | [c++] RSA Sample 4 CPP | hooni | 2013.04.23 | 9236 |
263 | Develop | [c] 최대공약수, 최소공배수, 서로소 구하기 (펌) | hooni | 2013.04.23 | 11189 |
262 | Algorithm | 스터디 자료, 암호화에 대해서.. 나중에 볼 ppt.. | hooni | 2013.04.23 | 13417 |