Brisi
Brisi

Reputation: 1821

Amazon RDS storage size is different

I am using AWS RDS database.

The db state says the storage size is 64GB. Refer attachment.

enter image description here

But the following query says only 156 MB Free Space available in the DB.

mysql> SELECT table_schema "Data Base Name",sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB", sum( data_free )/ 1024 / 1024 "Free Space in MB" FROM information_schema.TABLES GROUP BY table_schema;

+--------------------+----------------------+------------------+
| Data Base Name     | Data Base Size in MB | Free Space in MB |
+--------------------+----------------------+------------------+
| prod               |        8451.21875000 |     156.00000000 |
| test               |           0.28125000 |       0.00000000 |
| information_schema |           0.00781250 |       0.00000000 |
| mysql              |           5.43510628 |       0.00000000 |
+--------------------+----------------------+------------------+
4 rows in set (18.42 sec)

Can anyone clarify why the storage space different for this?

Upvotes: 3

Views: 829

Answers (1)

Saurabh
Saurabh

Reputation: 76

RDS probably has innondb_file_per_table set due to which its showing you space available for that table space. I think it might grow if you put more data in the table under that database, if there is space available (in this case it looks like there should be).

With cloud database services you should ideally be only looking at used disk space, which is returned to you by your first column. As to how much is available, should be a math of subtracting used space from provisioned space (plus I will leave some amount of space for logs and other stuff, not sure how RDS does this, but you need to amount for some overhead).

Upvotes: 0

Related Questions