From 416654adfbe325706de403607a68cd6dbee46be6 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 21 Sep 2021 17:32:10 +0200 Subject: [PATCH] service/history: Help the query to use a good index --- application/controllers/ServiceController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/controllers/ServiceController.php b/application/controllers/ServiceController.php index 44cbc3f7d..3fec500d5 100644 --- a/application/controllers/ServiceController.php +++ b/application/controllers/ServiceController.php @@ -123,7 +123,9 @@ public function historyAction() ->getSelectBase() ->where([ 'history_host_service.id = ?' => $this->service->id, - 'history_service.id = ?' => $this->service->id + 'history_service.id = ?' => $this->service->id, + 'history.service_id = ?' => $this->service->id, + 'history.object_type = ?' => 'service' ]); $before = $this->params->shift('before', time());