[TYPO3-core] RFC: Bug #13508: Use exec_TRUNCATETABLEquery() instead of DELETE FROM throughout the core

Peter Niederlag typo3-list at niekom.de
Thu Feb 11 11:47:23 CET 2010


Hello,

Dmitry Dulepov schrieb:
[...]
> As a developer, I'd like to simply use exec_DELETEquery. Why should I
> care if TRUNCATE is faster? I need to focus on my task, not on such
> minor issues :)
> 
> May be today TRUNCATE is faster and tomorrow it is not. This handling
> should be hidden inside the API, not inside every extension. Developers
> must not care what they use: DELETE or TRUNCATE. They must have exactly
> *one* way to do their task, not many ways. The system should decide on
> the implementation of DELETE, not the developer.

-1 from me.

truncate DOES NOT behave exactly the same as delete *!

Triggers will not be excecuted on truncate. For this reason it is a VERY
bad idea to transform a "delete *" into a "truncate"!

If in some future we make use of triggers we will have a bad mess and
also it might cause trouble for any people already using triggers.

As a developer I'd like my code to execute as I write it and not some
magic trying to change it into something else.

[...]

Greets,
Peter
-- 
Peter Niederlag
http://www.niekom.de * TYPO3 & EDV Dienstleistungen *


More information about the TYPO3-team-core mailing list