mysql> EXPLAIN SELECT obj1.name1 AS host_name ,obj1.name2 AS service_description ,nagios_servicestatus.problem_has_been_acknowledged ,nagios_servicestatus.scheduled_downtime_depth ,nagios_servicestatus.current_state ,nagios_hostgroups.hostgroup_id FROM `nagios_servicestatus` LEFT JOIN nagios_objects as obj1 ON nagios_servicestatus.service_object_id=obj1.object_id LEFT JOIN nagios_services ON nagios_servicestatus.service_object_id=nagios_services.service_object_id LEFT JOIN nagios_hosts ON nagios_hosts.display_name = obj1.name1 LEFT JOIN nagios_hostgroup_members ON nagios_hosts.host_object_id=nagios_hostgroup_members.host_object_id LEFT JOIN nagios_hostgroups ON nagios_hostgroups.hostgroup_id=nagios_hostgroup_members.hostgroup_id LEFT JOIN nagios_instances ON nagios_services.instance_id=nagios_instances.instance_id WHERE nagios_services.config_type='1' AND nagios_servicestatus.state_type > 0 AND nagios_servicestatus.current_state > 0 AND (nagios_hostgroups.alias = "core router group" OR nagios_hostgroups.alias = "core switches group" OR nagios_hostgroups.alias = "LLU SDSL DSLAMS" OR nagios_hostgroups.alias = "edge router group" OR nagios_hostgroups.alias = "edge switch group" OR nagios_hostgroups.alias = "PDU group" OR nagios_hostgroups.alias = "Manually Configured Servers"); +----+-------------+--------------------------+--------+-------------------------+-------------+---------+--------------------------------------------------------------------------+------+--------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+--------------------------+--------+-------------------------+-------------+---------+--------------------------------------------------------------------------+------+--------------------------+ | 1 | SIMPLE | nagios_hostgroups | ALL | PRIMARY | NULL | NULL | NULL | 15 | Using where | | 1 | SIMPLE | nagios_hosts | ALL | NULL | NULL | NULL | NULL | 607 | | | 1 | SIMPLE | nagios_services | index | NULL | instance_id | 8 | NULL | 791 | Using where; Using index | | 1 | SIMPLE | nagios_servicestatus | eq_ref | object_id,current_state | object_id | 4 | nagios.nagios_services.service_object_id | 1 | Using where | | 1 | SIMPLE | nagios_instances | eq_ref | PRIMARY | PRIMARY | 2 | nagios.nagios_services.instance_id | 1 | Using index | | 1 | SIMPLE | nagios_hostgroup_members | eq_ref | instance_id | instance_id | 8 | nagios.nagios_hostgroups.hostgroup_id,nagios.nagios_hosts.host_object_id | 1 | Using where; Using index | | 1 | SIMPLE | obj1 | eq_ref | PRIMARY | PRIMARY | 4 | nagios.nagios_services.service_object_id | 1 | Using where | +----+-------------+--------------------------+--------+-------------------------+-------------+---------+--------------------------------------------------------------------------+------+--------------------------+ ~