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;
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!