diff --git a/ip2country.install b/ip2country.install
index 13e8bfa..a393a3c 100644
--- a/ip2country.install
+++ b/ip2country.install
@@ -71,6 +71,7 @@ function ip2country_schema() {
     ),
     'indexes' => array(
       'country_registry' => array('country', 'registry'),
+      'ip' => array('ip_range_first', 'ip_range_last'),
     ),
     'primary key' => array('ip2country_id'),
   );
@@ -179,3 +180,10 @@ function ip2country_update_2() {
 
   return $ret;
 }
+
+/**
+ * Add index on IP ranges
+ */
+function ip2country_update_3() {
+  db_add_index('ip2country', 'ip', array('ip_range_first', 'ip_range_last'));
+}
