Search the MySQL manual:

5.2.12 Speed of DELETE Queries

If you want to delete all rows in the table, you should use TRUNCATE TABLE table_name. See section 6.4.7 TRUNCATE Syntax.

The time to delete a record is exactly proportional to the number of indexes. To delete records more quickly, you can increase the size of the index cache. See section 5.5.2 Tuning Server Parameters.

User Comments

Posted by Piter on Friday May 17 2002, @6:24am[Delete] [Edit]

"delete from ... order by ... limit ..." is very
slow.
A much faster way is to "select from ... order
by ... limit ..." and then "delete from ...
where ..." using the results of the previous
select query.

Add your own comment.