Skip to content

Commit f3e1b7d

Browse files
committed
Performance indices
1 parent 1208653 commit f3e1b7d

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-- CreateIndex
2+
CREATE INDEX "Group_status_organizationId_idx" ON "Group"("status", "organizationId");
3+
4+
-- CreateIndex
5+
CREATE INDEX "Group_domain_idx" ON "Group"("domain");
6+
7+
-- CreateIndex
8+
CREATE INDEX "Group_ssoId_idx" ON "Group"("ssoId");
9+
10+
-- CreateIndex
11+
CREATE INDEX "Group_privateGroup_status_idx" ON "Group"("privateGroup", "status");
12+
13+
-- CreateIndex
14+
CREATE INDEX "GroupMember_memberId_membershipType_idx" ON "GroupMember"("memberId", "membershipType");
15+
16+
-- CreateIndex
17+
CREATE INDEX "User_universalUID_idx" ON "User"("universalUID");

prisma/schema.prisma

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ model Group {
4545
@@index([name]) // Index for filtering by name
4646
@@index([status]) // Index for filtering by status
4747
@@index([oldId]) // Index for filtering by oldId
48+
@@index([status, organizationId])
49+
@@index([domain])
50+
@@index([ssoId])
51+
@@index([privateGroup, status])
4852
}
4953

5054
model GroupMembership {
@@ -63,7 +67,8 @@ model GroupMembership {
6367
@@unique([groupId, memberId])
6468
@@index([groupId]) // Index for joining with group table
6569
@@index([memberId]) // Index for filtering by memberId
66-
@@map("GroupMember")
70+
@@index([memberId, membershipType])
71+
@@map("GroupMember")
6772
}
6873

6974
// This user table is only used in this group challenge
@@ -74,4 +79,6 @@ model User {
7479
createdBy String
7580
updatedAt DateTime @updatedAt
7681
updatedBy String?
82+
83+
@@index([universalUID])
7784
}

0 commit comments

Comments
 (0)