Home > Database > Mysql Tutorial > body text

Detailed example of how to check the table size in MySql

黄舟
Release: 2017-08-11 14:22:34
Original
1839 people have browsed it

When the database takes up a lot of space, you can use the following statement to find a table with a large amount of data


SELECT 
    TABLE_NAME
    ,round((DATA_LENGTH/1024/1024),2)  'DATA_SIZE(M)'
    ,round((INDEX_LENGTH/1024/1024),2)  'INDEX_SIZE(M)'
    ,AVG_ROW_LENGTH
    ,MAX_DATA_LENGTH
    ,CREATE_TIMEFROM information_schema.tablesWHERE TABLE_SCHEMA ='库名'ORDER BY 2 desc;
Copy after login

Running results

The above is the detailed content of Detailed example of how to check the table size in MySql. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!