Skip to content

Commit db21135

Browse files
committed
chore(database): drop unused TaskRun status composite index
1 parent 61ca40b commit db21135

3 files changed

Lines changed: 8 additions & 1 deletion

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+
Reduce primary database write load on `TaskRun` by dropping an unused composite index on `(status, runtimeEnvironmentId, createdAt, id)`. After gating the legacy `WAITING_FOR_DEPLOY` drain to V1-engine workers only, no V2 Prisma query uses this index while it was still being maintained on every `TaskRun` INSERT/UPDATE.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- DropIndex
2+
DROP INDEX CONCURRENTLY IF EXISTS "public"."TaskRun_status_runtimeEnvironmentId_createdAt_id_idx";

internal-packages/database/prisma/schema.prisma

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,6 @@ model TaskRun {
10891089
@@index([runtimeEnvironmentId, batchId])
10901090
@@index([runtimeEnvironmentId, createdAt(sort: Desc)])
10911091
@@index([createdAt], type: Brin)
1092-
@@index([status, runtimeEnvironmentId, createdAt, id(sort: Desc)])
10931092
}
10941093

10951094
model TaskRunTemplate {

0 commit comments

Comments
 (0)