Project

General

Profile

Actions

Bug #22106

closed

Use exec_TRUNCATETABLEquery() instead of DELETE FROM throughout the core

Added by Christian Kuhn almost 15 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2010-02-11
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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)


Files

13508_01.diff (6.09 KB) 13508_01.diff Administrator Admin, 2010-02-11 02:16
13508_v3.diff (4.54 KB) 13508_v3.diff Administrator Admin, 2010-04-12 20:52
Actions #1

Updated by Christian Kuhn over 14 years ago

Committed v3 to trunk, rev. 7311.

Actions

Also available in: Atom PDF