-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Description
The query is quite heavy and there is no index on the timestamp column alone, so the delete is not using any index and therefor takes quite some time:
MariaDB [oc]> EXPLAIN DELETE FROM `oc_activity` WHERE `timestamp` < 1234567
-> ;
+------+-------------+-------------+------+---------------+------+---------+------+---------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+-------------+------+---------------+------+---------+------+---------+-------------+
| 1 | SIMPLE | oc_activity | ALL | NULL | NULL | NULL | NULL | 6673188 | Using where |
+------+-------------+-------------+------+---------------+------+---------+------+---------+-------------+
pierreozoux