Lawrence,

----- Alkuperäinen viesti ----- 
Lähettäjä: "Lawrence Smith" <[EMAIL PROTECTED]>
Vastaanottaja: "Heikki Tuuri" <[EMAIL PROTECTED]>
Kopio: <[EMAIL PROTECTED]>
Lähetetty: Sunday, February 01, 2004 1:03 PM
Aihe: Re: Shrinking innodb datafiles?


>
> --- Heikki Tuuri <[EMAIL PROTECTED]> wrote: >
> > >
> > > Just to confirm if I understand the situation
> > > correctly: innodb datafiles cannot be reduced in
> > size
> > > to reclaim spaced freed by deleted data?
> >
> > you are right.
>
> Once again thanks. One absolutely last question (only
> just occurred to me): will the space in the file used
> by the deleted data be reused?

yes, of course. Though, remember that if you randomly delete about 50 % of
rows, it may happen that no 16 kB page or 1 MB extent becomes completely
empty. Then the freed space can only be used by the same index tree from
which the space was freed. The way to reorganize an InnoDB table is to run a
'null' ALTER TABLE:

ALTER TABLE myinnodbtable TYPE = InnoDB;

Be prepared for a very long run time, since the above command completely
rebuilds the table. If you are using >=  MySQL-4.1.1 and storing InnoDB
tables to their own .ibd files, then the above command really frees the
space to the OS. That is because the ALTER TABLE table is performed by
creating a new .ibd file and deleting the old .ibd file.

> Thx
>
> Lawrence Smith

Best regards,

Heikki
Innobase Oy
http://www.innodb.com
InnoDB - transactions, row level locking, and foreign keys for MySQL
InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM
tables

Order MySQL support from http://www.mysql.com/support/index.html


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to