Discussion:
clean up tables after deletes
(too old to reply)
clb
2007-04-01 14:43:27 UTC
Permalink
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.
Gordon Burditt
2007-04-01 22:49:29 UTC
Permalink
Post by clb
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.
Post by clb
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.

Loading...