Sunday, January 13, 2013

Re: Reclaiming disk usage after deleting data?

Interestingly, doing a 'SELECT TABLE_NAME, TABLE_TYPE, TABLE_ROWS, DATA_LENGTH, DATA_FREE FROM TABLES;' in the console on the information_schema shows what I am expecting.  (The database in question is using almost no space and has almost 500MB free.)

So maybe the counter in the Cloud SQL console is off?  I'll try using it and report back if I hit the space limit unexpectedly.


On Sunday, January 13, 2013 4:22:23 PM UTC-8, KC Budd wrote:
I have a D0 (free trial) instance.   Yesterday, I populated it with a dump from a local MySQL database using the google_cloud_sql command.   I noticed that, while the entire sqldump output file was ~280MB, the claimed used space in the Google Cloud SQL console was ~400MB.    (Even the local files on my mysql instance aren't close to 400MB.)

After doing some queries and examining the output, I decided I didn't like one of the transformations done by the sqldump command (which naturally got propagated into the Cloud SQL instance.)  So, I deleted all the data in the table with a 'DELETE FROM' command. 

This took the disk usage reported in the Cloud SQL console from 400MB to 482MB.  (?)

So, I did a 'DROP TABLE' and removed the (now empty) table and recreated it.   No change, my instance is still reporting 482MB disk usage.  This was all several hours ago.  My questions:

1. Why is the disk space usage reported so much higher in Cloud SQL than on my local database?

2. Why did I not get the space back when I deleted the data?  (Or the table?)

3. Is there any way for me to reclaim the space?

No comments:

Post a Comment