Project

General

Profile

Actions

Bug #17189

closed

Replace DELETE FROM with faster TRUNCATE TABLE

Added by John Angel about 17 years ago. Updated almost 14 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2007-04-04
Due date:
% Done:

0%

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

Description

Instead of:

$query = 'DELETE FROM '. $components['TABLE']. (strlen($where) ? ' WHERE ' . $where : '');

Should be:

if(strlen($where))
{
$query = 'DELETE FROM '. $components['TABLE']. ' WHERE ' . $where;
}
else {
$query = 'TRUNCATE TABLE '. $components['TABLE'];
}

Ref source:
t3lib/class.t3lib_sqlparser.php:1367
t3lib/class.t3lib_db.php:427
sysext/adodb/adodb/adodb-perf.inc.php:662

Ref mysql doc:
http://dev.mysql.com/doc/refman/5.0/en/truncate.html

(issue imported from #M5370)

Actions

Also available in: Atom PDF