0

Query to Determine Disk Space Usage for AWS MySQL RDS

The following query will show you the disk space usage for an AWS MySQL RDS in MB:

SELECT table_schema, SUM(data_length + index_length)/1024/1024 AS Total_GB, SUM(data_length)/1024/1024 AS Data_GB, SUM(index_length)/1024/1024 AS Index_GB, COUNT(*) AS tables, CURDATE() AS today FROM information_schema.tables GROUP BY table_schema ORDER BY 2 DESC;

The following query will show you the disk space usage for an AWS MySQL RDS in GB:

SELECT table_schema, SUM(data_length + index_length)/1024/1024/1024 AS Total_GB, SUM(data_length)/1024/1024/1024 AS Data_GB, SUM(index_length)/1024/1024/1024 AS Index_GB, COUNT(*) AS tables, CURDATE() AS today FROM information_schema.tables GROUP BY table_schema ORDER BY 2 DESC;

Jason Edwards