Skip to content

Commit a059460

Browse files
committed
perf(database): index ProjectAlert.channelId so alert-channel deletes stop seq-scanning
1 parent 90e8bd5 commit a059460

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: improvement
4+
---
5+
6+
Deleting an alert channel is now fast and no longer slows down as a project builds up alert history.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- CreateIndex
2+
CREATE INDEX CONCURRENTLY IF NOT EXISTS "ProjectAlert_channelId_idx" ON "public"."ProjectAlert"("channelId");

internal-packages/database/prisma/schema.prisma

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2412,6 +2412,8 @@ model ProjectAlert {
24122412
24132413
createdAt DateTime @default(now())
24142414
updatedAt DateTime @updatedAt
2415+
2416+
@@index([channelId])
24152417
}
24162418

24172419
enum ProjectAlertType {

0 commit comments

Comments
 (0)