If you want to remove all rows in a table then you can use the
TRUNCATE statement which is much faster than
TRUNCATE TABLE empties a table completely. It requires the
DROP privilege. Logically,
TRUNCATE TABLE is similar to a
DELETE statement that deletes all rows, or a sequence of
DROP TABLE and
CREATE TABLE statements.
To achieve high performance,
TRUNCATE TABLE bypasses the DML method of deleting data. Thus, it does not cause
ON DELETE triggers to fire, it cannot be performed for InnoDB tables with parent-child foreign key relationships, and it cannot be rolled back like a DML operation.