by

Retrieve MySQL data, indexes and log size information

This SQL retrieves the information regarding the actual size of the data, indexes and log files for the given schema
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/343/Retrieve-MySQL-data--indexes-and-log-siz?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
select table_schema, table_name, concat( round( data_length / ( 1024 *1024 ) , 2 ) , 'Mb' ) data_length_mb, concat( round( index_length / ( 1024 *1024 ) , 2 ) , 'Mb' ) index_length_mb, concat( round( round( data_length + index_length ) / ( 1024 *1024 ) , 2 ) , 'Mb' ) total_size_mb from information_schema.tables where table_schema like '<your_schema>' order by data_length desc;
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus