60s+ Alerts / Events Query on large system

XMLWordPrintable

    • Type: Incident report
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: 2.4.5
    • Component/s: Frontend (F)
    • Environment:
      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)

            Assignee:
            Unassigned
            Reporter:
            Mathew
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: