Found that tables scans were occurring due to NULL table references in screens.php. graph_items (gi) is in several queries in the FROM clause but never used which causes huge table scans and deadlocks.
Note: This can be found 3 times in the screens files. After I removed graph_items from the query my response time is a lot quicker.
For example:
Note: This can be found 3 times in the screens files. After I removed graph_items from the query my response time is a lot quicker.
For example:
Code:
$result=DBselect('SELECT DISTINCT g.groupid, g.name '.
' FROM groups g, hosts_groups hg, hosts h, items i, [COLOR="Red"]graphs_items gi [/COLOR]'.
' WHERE g.groupid in ('.$availiable_groups.') '.
' AND hg.groupid=g.groupid '.
' AND h.status='.HOST_STATUS_MONITORED.
' AND h.hostid=i.hostid '.
' AND hg.hostid=h.hostid '.
' ORDER BY g.name');
fixed.
Comment