Skip to content

Instantly share code, notes, and snippets.

@stajnert
Created March 18, 2013 09:46
Show Gist options
  • Save stajnert/5186051 to your computer and use it in GitHub Desktop.
Save stajnert/5186051 to your computer and use it in GitHub Desktop.
db size
SELECT table_schema,
CONCAT(ROUND(SUM(data_length/(1024*1024)),2),'M') data,
CONCAT(ROUND(SUM(index_length/(1024*1024)),2),'M') idx,
CONCAT(ROUND((SUM(data_length+index_length)/(1024*1024)),2),'M') total_size
FROM information_schema.tables
GROUP BY table_schema
ORDER BY data_length+index_length DESC;
SHOW TABLE STATUS FROM etracker;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment