Skip to content

Instantly share code, notes, and snippets.

@wilkice
Last active January 27, 2022 16:57
Show Gist options
  • Save wilkice/615ecee9c7514941be84c2854212458c to your computer and use it in GitHub Desktop.
Save wilkice/615ecee9c7514941be84c2854212458c to your computer and use it in GitHub Desktop.
常用SQL #sql

show db disk usage

select table_schema, sum((data_length+index_length)/1024/1024) AS "Total size(table+index) Mb", sum(data_length/1024/1024) as "table size", sum(index_length/1024/1024) as "index size" 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