diff --git a/migrations/0047_operator_listener_mentions.sql b/migrations/0047_operator_listener_mentions.sql index 0cdb50cb60..41334ac838 100644 --- a/migrations/0047_operator_listener_mentions.sql +++ b/migrations/0047_operator_listener_mentions.sql @@ -29,6 +29,9 @@ CREATE INDEX operator_listener_match_queue_due CREATE INDEX operator_listener_match_queue_recovery ON operator_listener_match_queue (lease_until) WHERE state = 'matching'; +CREATE INDEX operator_listener_match_queue_claim + ON operator_listener_match_queue (claim_id) + WHERE state = 'matching'; CREATE TABLE operator_listener_outbox ( id UUID NOT NULL PRIMARY KEY DEFAULT gen_random_uuid(), diff --git a/schema/schema.sql b/schema/schema.sql index 33320f0ed9..f703eb2fc4 100644 --- a/schema/schema.sql +++ b/schema/schema.sql @@ -947,6 +947,9 @@ CREATE INDEX operator_listener_match_queue_due CREATE INDEX operator_listener_match_queue_recovery ON operator_listener_match_queue (lease_until) WHERE state = 'matching'; +CREATE INDEX operator_listener_match_queue_claim + ON operator_listener_match_queue (claim_id) + WHERE state = 'matching'; CREATE TABLE operator_listener_outbox ( id UUID NOT NULL PRIMARY KEY DEFAULT gen_random_uuid(),