-
Problem report
-
Resolution: Won't fix
-
Major
-
3.0.19, 3.4.11
-
Sprint 39
-
0.5
Latest data widget has popup with previous events information, to show the events Zabbix frontend performs the following query:
SELECT DISTINCT e.*,er1.r_eventid,er2.c_eventid,er2.correlationid,er2.userid FROM events e LEFT JOIN event_recovery er1 ON er1.eventid=e.eventid LEFT JOIN event_recovery er2 ON er2.r_eventid=e.eventid WHERE e.source='0' AND e.object='0' AND e.objectid='23656' AND e.eventid<='5790292' ORDER BY e.clock DESC,e.eventid DESC LIMIT 20 OFFSET 0
But in this case "event_recovery" table is not required at all. So it is good idea do not JOIN unnecessary tables to avoid performance issues. Small example patch for that:
Index: include/events.inc.php =================================================================== --- include/events.inc.php (revision 83107) +++ include/events.inc.php (working copy) @@ -442,7 +442,7 @@ $events = API::Event()->get([ 'source' => EVENT_SOURCE_TRIGGERS, 'object' => EVENT_OBJECT_TRIGGER, - 'output' => API_OUTPUT_EXTEND, + 'output' => ['clock', 'value', 'acknowledged'], 'objectids' => [$trigger['triggerid']], 'eventid_till' => $trigger['lastEvent']['eventid'], 'select_acknowledges' => API_OUTPUT_COUNT,
- duplicates
-
ZBXNEXT-2102 Merge Screens in to Dashboards (2)
- Closed