diff --git a/sql/tables.sql b/sql/tables.sql
index ab2f6c87ef5bed46c9191d22b48c7364740abc29..d30aadba2fc8da11576e8c03753e0408ea345401 100644
--- a/sql/tables.sql
+++ b/sql/tables.sql
@@ -159,7 +159,8 @@ CREATE TABLE analysis_job_file (
   type                    varchar(16) NOT NULL default '',
   path                    varchar(255) NOT NULL,
   
-  UNIQUE KEY job_hive_type  (analysis_job_id, hive_id, type)
+  UNIQUE KEY job_hive_type  (analysis_job_id, hive_id, type),
+  INDEX hive_id             (hive_id)
 );