Issue Bug Closed

#33532TYPO3 Backend is too slow if sys_log table is large

Dmitry Dulepov 01/30/12, 14:09 updated 10/23/17, 22:20

Description

A query is executed during the login process, which can take minutes during the BE login if the sys_log table is too large. Here is the analysis of the query:

mysql> explain SELECT tstamp FROM sys_log WHERE type=255 AND action=4 AND tstamp>1327922390 ORDER BY tstamp DESC limit 1;
+----+-------------+---------+------+---------------+------+---------+------+----------+-----------------------------+
| id | select_type | table   | type | possible_keys | key  | key_len | ref  | rows     | Extra                       |
+----+-------------+---------+------+---------------+------+---------+------+----------+-----------------------------+
|  1 | SIMPLE      | sys_log | ALL  | NULL          | NULL | NULL    | NULL | 13319619 | Using where; Using filesort |
+----+-------------+---------+------+---------------+------+---------+------+----------+-----------------------------+
1 row in set (0.06 sec)

In the process list:

mysql> show processlist;
+---------+---------------+-----------+---------------+---------+------+----------------+------------------------------------------------------------------------------------------------------+
| Id      | User          | Host      | db            | Command | Time | State          | Info                                                                                                 |
+---------+---------------+-----------+---------------+---------+------+----------------+------------------------------------------------------------------------------------------------------+
| 4794573 | xxx | localhost | xxx | Query   |  455 | Sorting result | SELECT tstamp FROM sys_log WHERE type=255 AND action=4 AND tstamp>1327922390 ORDER BY tstamp DESC LI |

A proper index would prevent an issue.

Reviews 0

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