Skip to content

Instantly share code, notes, and snippets.

@aonurdemir
Last active September 4, 2019 11:19
Show Gist options
  • Save aonurdemir/9670aa68e24c5d4b1278d2ed3fb2026c to your computer and use it in GitHub Desktop.
Save aonurdemir/9670aa68e24c5d4b1278d2ed3fb2026c to your computer and use it in GitHub Desktop.
Mysql Table Sizes
https://aws.amazon.com/premiumsupport/knowledge-center/view-storage-rds-mysql-mariadb/
#Run the following query to find the size of each user-created database:
select table_schema, round(sum(data_length+index_length)/1024/1024/1024,2) "size in GB" from information_schema.tables group by 1 order by 2 desc;
#In some cases, MySQL creates internal temporary tables that can't be removed because a query is intervening. These temporary tables aren't part of the table named "tables" inside information_schema. Run the following query to find these internal temporary tables:
select * from innodb_sys_tables where name like '%#%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment