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

Martin Kutschker masi-no at spam-typo3.org
Thu Feb 5 12:30:11 CET 2009


Peter Kuehn [wmdb] schrieb:
> Hi yall,
> 
> some questions to those, who know more about databases than i do:
> 
> How standard compliant is "truncate table"?

Not at all. It's a Mysql thingy.

> On which DBMS will it work or not work?
> Is ADODB able to rewrite it where it does not work?

We could add a simple wrapper in t3lib_db.

> Background:
> I plan to submit a patch request for t3lib_tcemain->clear_cacheCmd()
> where $cacheCmd=='all', if truncate table will not break DBAL.
> The currently used "DELETE FROM cache_*" calls end up as an entry in
> slow query logs on larger installs.

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?

Masi




More information about the TYPO3-dev mailing list