Skip to content

Commit a86417c

Browse files
committed
Add new index for TaskRun for the runs list, by environment ID
1 parent 07967bd commit a86417c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- CreateIndex
2+
CREATE INDEX CONCURRENTLY IF NOT EXISTS "TaskRun_runtimeEnvironmentId_createdAt_id_idx" ON "TaskRun"("runtimeEnvironmentId", "createdAt" DESC, "id" DESC);

internal-packages/database/prisma/schema.prisma

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,7 @@ model TaskRun {
681681
@@index([scheduleId, createdAt(sort: Desc)])
682682
// Finding runs in a batch
683683
@@index([runtimeEnvironmentId, batchId])
684+
@@index([runtimeEnvironmentId, createdAt(sort: Desc), id(sort: Desc)])
684685
}
685686

686687
enum TaskRunStatus {

0 commit comments

Comments
 (0)