diff --git a/gstlal-inspiral/share/simplify_and_cluster.sql b/gstlal-inspiral/share/simplify_and_cluster.sql
index 9d2373f3246a7e39aad0dfe9367b8ed0d9a059d0..6feb576e645c9c9e83873d6c2a6a612bf70ce230 100644
--- a/gstlal-inspiral/share/simplify_and_cluster.sql
+++ b/gstlal-inspiral/share/simplify_and_cluster.sql
@@ -112,7 +112,7 @@ DROP TABLE _idmap_;
 -- references to their IDs in other tables
 --
 
-CREATE INDEX tmpindex ON segment(segment_def_id, start_time, start_time_ns, end_time, end_time_ns);
+CREATE INDEX tmpindex ON segment(segment_def_id, start_time, start_time_ns, end_time, end_time_ns, segment_id);
 
 DELETE FROM
 	segment