Issue Bug Closed

#22106Use exec_TRUNCATETABLEquery() instead of DELETE FROM throughout the core

Christian Kuhn 02/11/10, 02:15 updated 07/02/10, 11:16

Description

Problem:
Thanks to #22104 we now have a dbal compatible way of truncating tables in mysql.

Solution:
Use this new API method core wide where DELETE FROM with an empty where was called.

Notes:
- There is a nice performance improvement for the clearing of cache tables (if not using caching framework, which already did a direct TRUNCATE), especially if they are filled with hundreds of thousands of records on a system under load. mysql “truncate” is way faster than “delete from”, especially on innodb where concurrent queries where usually stuck because of innodb’s transaction capabilities.
- Warning: In comparison to delete, truncate does (!) reset the auto_increment value to zero. Because of this I’m currently not 100% sure about the two hunks in typo3/sysext/extbase/Classes/Utility/Cache.php and the second hunk in typo3/sysext/install/mod/class.tx_install.php. Please review carefully.

(issue imported from #M13508)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.