Flip base tables in HoststatusQuery

This has no performance impact but all our queries should start w/ select from icinga_objects.
This commit is contained in:
Eric Lippmann 2017-07-27 15:03:12 +02:00 committed by Eric Lippmann
parent 370d148072
commit 9b529bcd15
1 changed files with 3 additions and 4 deletions

View File

@ -175,17 +175,16 @@ class HoststatusQuery extends IdoQuery
if (version_compare($this->getIdoVersion(), '1.10.0', '<')) {
$this->columnMap['hoststatus']['host_check_source'] = '(NULL)';
}
if (version_compare($this->getIdoVersion(), '1.13.0', '<')) {
$this->columnMap['hoststatus']['host_is_reachable'] = '(NULL)';
}
$this->select->from(
array('h' => $this->prefix . 'hosts'),
array('ho' => $this->prefix . 'objects'),
array()
)->join(
array('ho' => $this->prefix . 'objects'),
'ho.object_id = h.host_object_id AND ho.is_active = 1 AND ho.objecttype_id = 1',
array('h' => $this->prefix . 'hosts'),
'h.host_object_id = ho.object_id AND ho.is_active = 1 AND ho.objecttype_id = 1',
array()
);
$this->joinedVirtualTables['hosts'] = true;