Innodb ibd file size decreased 1/3 after being added a field

14 views
Skip to first unread message

James Wang

unread,
Nov 26, 2015, 4:20:54 AM11/26/15
to Percona Discussion
Hi All,

I could not explain this.

My MySQL is Percona 5.6

Thanks a lot in advance

Caio James

unread,
Nov 26, 2015, 9:56:26 AM11/26/15
to percona-d...@googlegroups.com
James -

Assuming you meant the IBD file for the table?

Innodb does not automatically recover disk space when data is deleted from a table. The only time this happens is when an `alter table` or `optimize table` is executed on the table itself.

In your case, you added a column using `alter table` and the table was rebuilt with the new column, reclaiming the disk space from previously deleted records.

See this stack exchange for a good explanation:


Caio

--
You received this message because you are subscribed to the Google Groups "Percona Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to percona-discuss...@googlegroups.com.
To post to this group, send email to percona-d...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

James Wang

unread,
Nov 26, 2015, 10:09:20 AM11/26/15
to Percona Discussion
Thanks a lot. 

The table exists a while now but not in a production and maybe I forgot deleting any rows.

On Thursday, 26 November 2015 14:56:26 UTC, Caio James wrote:
James -

Assuming you meant the IBD file for the table?

Innodb does not automatically recover disk space when data is deleted from a table. The only time this happens is when an `alter table` or `optimize table` is executed on the table itself.

In your case, you added a column using `alter table` and the table was rebuilt with the new column, reclaiming the disk space from previously deleted records.

See this stack exchange for a good explanation:


Caio

On Nov 26, 2015, at 1:20 AM, James Wang <jwang...@gmail.com> wrote:

Hi All,

I could not explain this.

My MySQL is Percona 5.6

Thanks a lot in advance

--
You received this message because you are subscribed to the Google Groups "Percona Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to percona-discussion+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages