Skip to content

Instantly share code, notes, and snippets.

@bhathiya
Created June 9, 2013 18:47
Show Gist options
  • Select an option

  • Save bhathiya/5744689 to your computer and use it in GitHub Desktop.

Select an option

Save bhathiya/5744689 to your computer and use it in GitHub Desktop.
SELECT
table_schema "DATABASE_NAME",
(sum( data_length + index_length ) / 1024 / 1024) "DISK_USAGE",
(sum(data_free)/ 1024 / 1024) "FREE_SPACE"
FROM information_schema.TABLES
GROUP BY table_schema;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment