Last active
January 23, 2024 22:22
-
-
Save JonnoN/44398384b3a8b4ff5473b336eeb1c0e2 to your computer and use it in GitHub Desktop.
mysql information_schema copypasta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use information_schema; | |
select table_schema, sum(data_length)/1024/1024/1024 as data_gb, sum(index_length)/1024/1024/1024 as index_gb, sum(data_free)/1024/1024/1024 as free_gb from tables group by table_schema; | |
select table_schema, table_name, data_length/1024/1024/1024 as data_gb, index_length/1024/1024/1024 as index_gb, data_free/1024/1024/1024 as free_gb from tables where table_schema not in ('mysql', 'information_schema', 'performance_schema', 'sys') order by data_gb; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment