AWS RDS-Aurora MySQL disk space issue and mismatch

Viewed 41

I have configured an Aurora-Mysql provisioned cluster with only one instance running MySQL engine 5.7, and so far so good ....

I was trying to identify and see the amount of space that I am/was using and via cloudwatch I got this

Billed Volume Bytes Used

so it looks like that the size of my db is around 400GB, but If I run a query that analyze the total space like this

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;

Source https://aws.amazon.com/premiumsupport/knowledge-center/view-storage-rds-mysql-mariadb/

I have an output like this

# table_schema  size in GB
mydbschema  205.74
mysql   0.01
information_schema  0.00
sys 0.00
performance_schema  0.00

any idea about what I should check or review?

I have already run an OPTIMIZE TABLE.

1 Answers

Run the stats again, but include Data_free this time. That would include some pre-allocated space that is not yet in use for either Data or Index.

Also check the size if ibdata1. You may have created large tables (permanent or temporary) there, but then either moved to their own .ibd or dropped them.

Also, please provide the number of tables and number of partitions.

Related