-
Incident report
-
Resolution: Unresolved
-
Trivial
-
None
-
2.4.5
-
Debian / MySQL
When loading tr_events.php on a large system the query to fetch the alerts is poorly optimized and results in a 60s+ load time.
SELECT a.* FROM alerts a WHERE EXISTS (SELECT NULL FROM events e WHERE a.eventid=e.eventid AND e.source='0' AND e.object='0') AND (a.alertid BETWEEN '1591062' AND '1591074' OR a.alertid IN ('1590893','1591357')) ORDER BY a.clock DESC
It seems to be doing a full table scan on the events table (20m records)