--- uc_order.install.orig       2009-05-17 18:22:54.000000000 -0700
+++ uc_order.install    2009-05-17 18:47:29.000000000 -0700
@@ -502,6 +502,8 @@ function uc_order_schema() {
     ),
     'indexes' => array(
       'order_id' => array('order_id'),
+      'qty' => array('qty'),
+      'nid' => array('nid'),
     ),
     'primary key' => array('order_product_id'),
   );
@@ -987,3 +989,12 @@ function uc_order_update_6010(&$sandbox)
 
   return $ret;
 }
+/**
+ * Add an index so that product and customer reports are usable with large datasets
+ */
+function uc_order_update_6011() {
+  $ret = array();
+  db_add_index($ret, 'uc_order_products', 'qty', array('qty'));
+  db_add_index($ret, 'uc_order_products', 'nid', array('nid'));
+}
+
