MySQL Forums
Forum List  »  InnoDB

Re: innodb ibd file size
Posted by: Ryan Thiessen
Date: December 09, 2008 01:25PM

Since you are using file-per table, you don't have to use the method that KimSeong suggested. Instead you can just use OPTIMIZE TABLE which recreates the table in place, as per the following example.

mysql> \! ls -lh;
total 117M
-rw-rw---- 1 mysql mysql 8.4K 2008-12-09 11:22 a.frm
-rw-rw---- 1 mysql mysql 116M 2008-12-09 11:23 a.ibd
mysql> truncate a;
Query OK, 0 rows affected (0.14 sec)

mysql> optimize table a;
+--------+----------+----------+-------------------------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+--------+----------+----------+-------------------------------------------------------------------+
| test.a | optimize | note | Table does not support optimize, doing recreate + analyze instead |
| test.a | optimize | status | OK |
+--------+----------+----------+-------------------------------------------------------------------+
2 rows in set (0.21 sec)

mysql> \! ls -lh;
total 108K
-rw-rw---- 1 mysql mysql 8.4K 2008-12-09 11:23 a.frm
-rw-rw---- 1 mysql mysql 96K 2008-12-09 11:23 a.ibd

Options: ReplyQuote


Subject
Views
Written By
Posted
6763
December 02, 2008 02:24PM
2840
December 02, 2008 06:32PM
2844
December 03, 2008 10:50AM
2804
December 03, 2008 06:18PM
2696
December 04, 2008 09:12AM
Re: innodb ibd file size
3196
December 09, 2008 01:25PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.