[TYPO3-dev] How standard compliant is "truncate"?

Dmitry Dulepov dmitry at typo3.org
Thu Feb 5 15:39:59 CET 2009


Hi!

Martin Kutschker wrote:
> Is truncate really faster?  I assumed that a DELETE without a WHERE
> clause will work internally the same as a TRUNCATE.
> 
> BTW, is there any difference for MyIsam or InnoDB tables?

Yes. TRUNCATE on InnoDB is an alias for DELETE and deletes all rows inside one internal transaction.

TRUNCATE on MyISAM is much faster than delete because it just resets row counter to 0. DELETE removes all rows and much slower on MyISAM with many rows.

-- 
Dmitry Dulepov
TYPO3 core team
"Sometimes they go bad. No one knows why" (Cameron, TSCC, "Dungeons&Dragons")




More information about the TYPO3-dev mailing list