From fda92507964b9521b632a97c9e343b4639a657f7 Mon Sep 17 00:00:00 2001 From: Joe7 Date: Mon, 27 Dec 2010 14:03:11 +0100 Subject: Added limit on select as for the outcome it doesn't matter if there are 20 rows or just 1. Is sufficient to return straight after reading 1 row. --- modules/gallery/libraries/drivers/Cache/Database.php | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/gallery/libraries') diff --git a/modules/gallery/libraries/drivers/Cache/Database.php b/modules/gallery/libraries/drivers/Cache/Database.php index b7822811..4f57b3da 100644 --- a/modules/gallery/libraries/drivers/Cache/Database.php +++ b/modules/gallery/libraries/drivers/Cache/Database.php @@ -34,6 +34,7 @@ class Cache_Database_Driver extends Cache_Driver { $count = db::build() ->where("key", "=", $id) ->where("expiration", ">=", time()) + ->limit("1") ->count_records("caches"); return $count > 0; } -- cgit v1.2.3