clean up tables after deletes

I noticed that in phpMyAdmin there is a way to cleanup and compact
tables that have had lots of deletes done to them. Can anyone tell me
how to do that manually? I find phpMyAdmin to be a pain so I don't want
to use it but I would like to compact some tables that got bloated with
testing and are now much smaller than before. The main reason I want to
clean them up is that new records go into slots previously used and
deleted instead of going at the end, where they naturally belong
(chronologically). Thanks.
clb [ So, 01 April 2007 16:43 ] [ ID #1674915 ]

Re: clean up tables after deletes

>I noticed that in phpMyAdmin there is a way to cleanup and compact
>tables that have had lots of deletes done to them. Can anyone tell me
>how to do that manually?

OPTIMIZE TABLE or REPAIR TABLE

Also, if you want to do a lot of them, see mysqlcheck.

>I find phpMyAdmin to be a pain so I don't want
>to use it but I would like to compact some tables that got bloated with
>testing and are now much smaller than before. The main reason I want to
>clean them up is that new records go into slots previously used and
>deleted instead of going at the end, where they naturally belong
>(chronologically). Thanks.

In SQL, records do not have an order, unless you use ORDER BY. The
physical location of records is not something you should be worrying
about or depending on.
gordonb.pe07w [ Mo, 02 April 2007 00:49 ] [ ID #1676183 ]
Datenbanken » mailing.database.mysql » clean up tables after deletes

Vorheriges Thema: Multiplying matches, complex query
Nächstes Thema: Matching a row to multiple rows in another table.