[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;
- 
		
				
		Read More[php] 3 Ways to Detect Mobile or Desktop in PHP
- 
		
				
		Read More자주 쓰는 Docker 명령어 alias
- 
		
				
		Read More[python][django] request.cookie 읽어오기 ㅋㅋㅋ (쓰기)
- 
		
				
		Read MoreSSH Passwordless Login Using SSH Keygen in 5 Easy Steps
- 
		
				
		Read More[virtualbox] VirtualBox에 Ubuntu 설치하기
- 
		
				
		Read More[mysql] MySQL 데이터베이스 추가 및 사용자 추가
- 
		
				
		Read More[oracle] Oracle 사용자 추가 절차
- 
		
				
		Read More[mysql] MySQL 백업 및 복구
- 
		
				
		Read More[mysql] MySql DB/테이블 사이즈 확인을 위한 쿼리
- 
		
				
		Read MoreSQL JOIN 정리 (Inner Join & Outer Join)
- 
		
				
		Read More[python] 파라미터 앞에 *, ** 의 의미? (*args, **kwargs)
- 
		
				
		Read More링크들 보고 지울 내용
 SQL JOIN 정리 (Inner Join & Outer Join)
							SQL JOIN 정리 (Inner Join & Outer Join)