Issue Bug Rejected

#67449Slow backend for systems/users with high amounts of sys_log entries

Nils Blattner 06/15/15, 09:44 updated 08/21/15, 11:44

Description

Hi there

If a system/user has a lot of sys_log entries associated, the backend for that user becomes unbearably slow (20s+ for 250k entries). The reason behind this is a query in typo3/sysext/core/Classes/DataHandling/DataHandler.php:

6.2.9 line 7313: $res_log = $GLOBALS[‘TYPO3_DB’]->exec_SELECTquery(‘*’, ‘sys_log’, ‘type=1 AND userid=’ . (int)$this->BE_USER->user[‘uid’] . ‘ AND tstamp=’ . (int)$GLOBALS[‘EXEC_TIME’] . ‘ AND error<>0’);

Because there is no index over error, the query cannot be optimized properly. When adding an index over “error”, the speed is is improved dramatically (20s => 1s) and if I add an index over type, userid, tstamp and error, the query obviously is sped up even more dramatically (<0.01s).

ALTER TABLE `sys_log`
ADD INDEX `print_error_log` (`type`, `userid`, `tstamp`, `error`);

Kind regards
Nils

Reviews 0

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