-
Incident report
-
Resolution: Won't fix
-
Minor
-
None
-
1.8.10
-
Ubuntu 10.04 on both UI and DB. Mariadb 5.2.3 with TokuDB 5.2.7-38674
When having other problems the current query becomes unusable, but our internally developed version still returns. When not having other problems the internal version is still faster.
Original query: SELECT t.* FROM triggers t WHERE ((t.triggerid BETWEEN 100000000000000 AND 199999999999999)) AND NOT EXISTS ( SELECT ff.functionid FROM functions ff WHERE ff.triggerid=t.triggerid AND EXISTS ( SELECT ii.itemid FROM items ii, hosts hh WHERE ff.itemid=ii.itemid AND hh.hostid=ii.hostid AND ( ii.status<>0 OR hh.status<>0 ) ) ) AND t.status=0 AND EXISTS( SELECT e.eventid FROM events e WHERE e.objectid=t.triggerid AND e.object=0 AND e.value=1 AND e.acknowledged=0) AND ((t.value=1) OR ((t.value=0) AND (t.lastchange>1334175861))) ORDER BY t.description ASC;
Suggested query: SELECT distinct t.* FROM triggers t, events e WHERE ((t.triggerid BETWEEN 100000000000000 AND 199999999999999)) AND NOT EXISTS ( SELECT ff.functionid FROM functions ff, items ii, hosts hh where ff.triggerid=t.triggerid AND ff.itemid=ii.itemid AND hh.hostid=ii.hostid AND ( ii.status<>0 OR hh.status<>0 ) ) AND t.status=0 and e.objectid=t.triggerid and e.object=0 and e.value=1 and e.acknowledged=0 AND ((t.value=1) OR ((t.value=0) AND (t.lastchange>1334175861))) ORDER BY t.description ASC;