Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-9850

Slow Latest 20 issues for a lot of PROBLEM triggers with filtering by host groups

XMLWordPrintable

      Currently Zabbix makes a few same queries like:

      SQL (36.204838): SELECT DISTINCT t.triggerid,t.state,t.error,t.url,t.expression,t.description,t.priority,t.lastchange FROM triggers t,functions f,items i,hosts_groups hg WHERE NOT EXISTS (SELECT NULL FROM functions f,items i,hosts_groups hgg LEFT JOIN rights r ON r.id=hgg.groupid AND r.groupid IN ('100100000000011','100100000000030','100100000000066','100100000000136') WHERE t.triggerid=f.triggerid AND f.itemid=i.itemid AND i.hostid=hgg.hostid GROUP BY i.hostid HAVING MAX(permission)<'2' OR MIN(permission) IS NULL OR MIN(permission)=0) AND hg.hostid=i.hostid AND f.triggerid=t.triggerid AND f.itemid=i.itemid AND hg.groupid IN ('100100000000784','100100000000785','100100000000787','100100000001627','100100000001628') AND NOT EXISTS (SELECT NULL FROM functions f,items i,hosts h WHERE t.triggerid=f.triggerid AND f.itemid=i.itemid AND i.hostid=h.hostid AND (i.status<>0 OR h.status<>0)) AND t.status=0 AND t.priority BETWEEN '0' AND '5' AND t.value='1' AND t.flags IN ('0','4') ORDER BY t.lastchange DESC LIMIT 40 OFFSET 0
      dashboard.php:145 ? make_latest_issues() ? CFrontendApiWrapper->get() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CTrigger->get() ? CApiService->customFetch() ? DBselect() in ./include/classes/api/CApiService.php:984
      

      and

      SQL (38.311494): SELECT DISTINCT COUNT(DISTINCT t.triggerid) AS rowscount FROM triggers t,functions f,items i,hosts_groups hg WHERE NOT EXISTS (SELECT NULL FROM functions f,items i,hosts_groups hgg LEFT JOIN rights r ON r.id=hgg.groupid AND r.groupid IN ('100100000000011','100100000000030','100100000000066','100100000000136') WHERE t.triggerid=f.triggerid AND f.itemid=i.itemid AND i.hostid=hgg.hostid GROUP BY i.hostid HAVING MAX(permission)<'2' OR MIN(permission) IS NULL OR MIN(permission)=0) AND hg.hostid=i.hostid AND f.triggerid=t.triggerid AND f.itemid=i.itemid AND hg.groupid IN ('100100000000784','100100000000785','100100000000787','100100000001627','100100000001628') AND NOT EXISTS (SELECT NULL FROM functions f,items i,hosts h WHERE t.triggerid=f.triggerid AND f.itemid=i.itemid AND i.hostid=h.hostid AND (i.status<>0 OR h.status<>0)) AND t.status=0 AND t.priority BETWEEN '0' AND '5' AND t.value='1' AND t.flags IN ('0','4')
      dashboard.php:145 ? make_latest_issues() ? CFrontendApiWrapper->get() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CTrigger->get() ? DBselect() in ./include/classes/api/services/CTrigger.php:428
      

      In case of more than 5000 triggers in PROBLEM, these queries can take long time.

            Unassigned Unassigned
            dotneft Alexey Pustovalov
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: