From f3ca80ffced18497322a74b8b49e94e88bb31cdc Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 27 Apr 2015 14:44:19 +0200 Subject: [PATCH] Don't fetchAll() and loop afterwards in the alert summary report refs #8340 --- .../application/controllers/AlertsummaryController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/monitoring/application/controllers/AlertsummaryController.php b/modules/monitoring/application/controllers/AlertsummaryController.php index dcc805286..5b4e2e3fa 100644 --- a/modules/monitoring/application/controllers/AlertsummaryController.php +++ b/modules/monitoring/application/controllers/AlertsummaryController.php @@ -274,7 +274,6 @@ class Monitoring_AlertsummaryController extends Controller ); $defects = array(); - $records = $query->getQuery()->fetchAll(); $period = $this->createPeriod($interval); foreach ($period as $entry) { @@ -282,7 +281,7 @@ class Monitoring_AlertsummaryController extends Controller $defects[$id] = array($id, 0); } - foreach ($records as $item) { + foreach ($query as $item) { $id = $this->getPeriodFormat($interval, $item->timestamp); if (empty($defects[$id])) { $defects[$id] = array($id, 0);