Why 'delete from table' takes a long time when 'truncate table' takes 0 time?

ripper234 picture ripper234 · Dec 24, 2008 · Viewed 10.9k times · Source

(I've tried this in MySql)

I believe they're semantically equivalent. Why not identify this trivial case and speed it up?

Answer

Otávio Décio picture Otávio Décio · Dec 24, 2008

truncate table cannot be rolled back, it is like dropping and recreating the table.