SELECT
s and Other Queries
EXPLAIN
Syntax (Get Information About a SELECT
)
SELECT
Queries
WHERE
Clauses
IS NULL
DISTINCT
LEFT JOIN
and RIGHT JOIN
ORDER BY
LIMIT
INSERT
Queries
UPDATE
Queries
DELETE
Queries
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.
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.