ServicegroupQuery: Improve JOIN performance

refs #9009
This commit is contained in:
Johannes Meyer 2015-06-16 08:12:00 +02:00
parent c0552b092a
commit 8bf269c2b3
1 changed files with 2 additions and 16 deletions

View File

@ -49,15 +49,8 @@ class ServicegroupQuery extends IdoQuery
array()
)->join(
array('sgo' => $this->prefix . 'objects'),
'sg.servicegroup_object_id = sgo.object_id',
'sg.servicegroup_object_id = sgo.object_id AND sgo.is_active = 1 AND sgo.objecttype_id = 4',
array()
)->where(
'sgo.is_active = ?',
1
)
->where(
'sgo.objecttype_id = ?',
4
);
$this->joinedVirtualTables = array('servicegroups' => true);
}
@ -78,15 +71,8 @@ class ServicegroupQuery extends IdoQuery
array()
)->join(
array('hgo' => $this->prefix . 'objects'),
'hgo.object_id = hg.hostgroup_object_id',
'hgo.object_id = hg.hostgroup_object_id AND hgo.is_active = 1 AND hgo.objecttype_id = 3',
array()
)->where(
'hgo.is_active = ?',
1
)
->where(
'hgo.objecttype_id = ?',
3
);
}