Skip to content

Instantly share code, notes, and snippets.

View Justintime50's full-sized avatar

Justin Hammond Justintime50

View GitHub Profile
@Justintime50
Justintime50 / check-db-size.sql
Created November 27, 2024 22:34
Check the size of your database
SELECT
table_name AS `Table`,
table_rows AS `Records`,
ROUND((data_length + index_length) / 1024 / 1024, 2) AS `Size (MB)`
FROM
information_schema.tables
WHERE
table_schema = 'your_db_table'
ORDER BY
`Size (MB)` DESC;