From dd1f068ff7ee40daa8ace603beacb9a90807532a Mon Sep 17 00:00:00 2001 From: DevotionGeo Date: Tue, 10 Nov 2015 00:40:31 +0500 Subject: [PATCH] Update MY_Model.php, add limit to the query in get funtion. If we are sure that we need only one record, than why not to make that execution faster by limiting the result to one record. --- core/MY_Model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/MY_Model.php b/core/MY_Model.php index 05add98..002adab 100644 --- a/core/MY_Model.php +++ b/core/MY_Model.php @@ -122,6 +122,7 @@ public function __construct() */ public function get($primary_value) { + $this->db->limit(1); return $this->get_by($this->primary_key, $primary_value); }