From 9ccc3403f8a537ee7d8a50c2b0f5439a1130f1f4 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Mon, 11 Nov 2013 12:42:35 +0100 Subject: [PATCH] [UPDATED] Query improved for first blocks time --- public/include/classes/statistics.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/public/include/classes/statistics.class.php b/public/include/classes/statistics.class.php index be80e77f..bae7ed81 100644 --- a/public/include/classes/statistics.class.php +++ b/public/include/classes/statistics.class.php @@ -30,9 +30,7 @@ class Statistics extends Base { $this->debug->append("STA " . __METHOD__, 4); if ($data = $this->memcache->get(__FUNCTION__)) return $data; $stmt = $this->mysqli->prepare(" - SELECT - IFNULL(time, 0) AS time FROM " . $this->block->getTableName() . " - ORDER BY id ASC LIMIT 1"); + SELECT IFNULL(MIN(time), 0) AS time FROM " . $this->block->getTableName()); if ($this->checkStmt($stmt) && $stmt->execute() && $result = $stmt->get_result()) return $result->fetch_object()->time; return false;