Hi,
I have a scenario with 4000 hosts and each host must be an IT Services too.
When I add/update an IT Services, function add_service() (includes/services.inc.php) calls update_services_status_all().
The problem is the update_services_status_all() executes 3 queries for each node (inside while()).
If I have 4000 IT Services, to create a new IT Services, 12000 queries will be executed!!
I have a scenario with 4000 hosts and each host must be an IT Services too.
When I add/update an IT Services, function add_service() (includes/services.inc.php) calls update_services_status_all().
The problem is the update_services_status_all() executes 3 queries for each node (inside while()).
If I have 4000 IT Services, to create a new IT Services, 12000 queries will be executed!!
Code:
DEBUG: SELECT s.status FROM services s,services_links l WHERE l.serviceupid=1 AND s.serviceid=l.servicedownid ORDER BY s.status DESC DEBUG: UPDATE services SET status = 0 WHERE serviceid=1 DEBUG: SELECT servicealarmid, value FROM service_alarms WHERE serviceid=1 ORDER BY servicealarmid DESC LIMIT 1 OFFSET 0 DEBUG: SELECT s.status FROM services s,services_links l WHERE l.serviceupid=2 AND s.serviceid=l.servicedownid ORDER BY s.status DESC DEBUG: UPDATE services SET status = 0 WHERE serviceid=2 DEBUG: SELECT servicealarmid, value FROM service_alarms WHERE serviceid=2 ORDER BY servicealarmid DESC LIMIT 1 OFFSET 0 ... DEBUG: SELECT s.status FROM services s,services_links l WHERE l.serviceupid=2100 AND s.serviceid=l.servicedownid ORDER BY s.status DESC DEBUG: UPDATE services SET status = 0 WHERE serviceid=2100 DEBUG: SELECT servicealarmid, value FROM service_alarms WHERE serviceid=2100 ORDER BY servicealarmid DESC LIMIT 1 OFFSET 0