
information_schema.tables의 도움으로 이 작업을 수행할 수 있습니다. 구문은 다음과 같습니다. -
1 2 3 4 | SELECT TABLE_NAME, table_rows, data_length, index_length,
round (((data_length + index_length) / 1024 / 1024),2) "MB Size"
FROM information_schema.TABLES WHERE table_schema = "yourDatabaseName"
ORDER BY (data_length + index_length) ASC;
|
로그인 후 복사
위 구문을 이해하기 위해 모든 데이터베이스에 대해 구현해 보겠습니다. 여기서는 데이터베이스 TEST를 사용하고 있습니다. 데이터베이스 TEST에 대한 쿼리를 살펴보겠습니다.
1 2 3 4 | mysql> SELECT TABLE_NAME, table_rows, data_length, index_length,
-> round (((data_length + index_length) / 1024 / 1024),2) "MB Size"
-> FROM information_schema.TABLES WHERE table_schema = "test"
-> ORDER BY (data_length + index_length) ASC;
|
로그인 후 복사
아래는 크기별로 정렬된 테이블을 보여주는 출력입니다.
rreee
위 내용은 크기와 크기별로 정렬된 MySQL 테이블을 나열하시겠습니까?의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!