Skip to content

Commit 3188dc9

Browse files
authored
perf(webapp): Add BatchTaskRun index to speed up the batch list dashboard page (#2499)
1 parent 10e7985 commit 3188dc9

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
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 "BatchTaskRun_runtimeEnvironmentId_id_idx" ON "public"."BatchTaskRun"("runtimeEnvironmentId", "id" DESC);

internal-packages/database/prisma/schema.prisma

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,8 @@ model BatchTaskRun {
15781578
///this is used for all engine versions
15791579
@@unique([runtimeEnvironmentId, idempotencyKey])
15801580
@@index([dependentTaskAttemptId])
1581+
// This is for the batch list dashboard page
1582+
@@index([runtimeEnvironmentId, id(sort: Desc)])
15811583
}
15821584

15831585
enum BatchTaskRunStatus {

0 commit comments

Comments
 (0)