Posts Tagged ‘information_schema’

Table Sizes

Posted: 21st December 2008 by Darren Cassar in Beginner
Tags: , ,

During the course of my daily work I occasionally search for mysql queries which are cool and helpful. I once found the following query on http://forge.mysql.com/: SELECT table_name article_attachment, engine, ROUND(data_length/1024/1024,2) total_size_mb, ROUND(index_length/1024/1024,2) total_index_size_mb, table_rows FROM information_schema.tables WHERE table_schema = ‘dbname’ ORDER BY 3 desc; A generally  lite version is: select table_schema, table_name, (data_length)/pow(1024,2) AS ‘Data [...]