From c7ad0bc58904d5eb73d0839cba75cc6799d148a7 Mon Sep 17 00:00:00 2001 From: Jarrod Sibbison Date: Mon, 21 Sep 2026 09:58:45 +1000 Subject: [PATCH] perf(db): index operator listener match claims Signed-off-by: Jarrod Sibbison --- migrations/0047_operator_listener_mentions.sql | 3 +++ schema/schema.sql | 3 +++ 2 files changed, 6 insertions(+) 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(),