Skip to content

Commit a3b80db

Browse files
committed
perf(database): drop unused TaskRun(scheduleId, createdAt) index
The schedule list view reads from ClickHouse, so this composite index served no Prisma query while still being maintained on every TaskRun INSERT/UPDATE.
1 parent 71d98b4 commit a3b80db

3 files changed

Lines changed: 8 additions & 2 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+
Reduce primary database write load on `TaskRun` by dropping an unused composite index on `(scheduleId, createdAt)`. The schedule list view reads from ClickHouse, so this Postgres index served no Prisma query while still being maintained on every `TaskRun` INSERT/UPDATE.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- DropIndex
2+
DROP INDEX CONCURRENTLY IF EXISTS "public"."TaskRun_scheduleId_createdAt_idx";

internal-packages/database/prisma/schema.prisma

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,8 +1084,6 @@ model TaskRun {
10841084
// Run page inspector
10851085
@@index([spanId])
10861086
@@index([parentSpanId])
1087-
// Schedule list page
1088-
@@index([scheduleId, createdAt(sort: Desc)])
10891087
// Finding runs in a batch
10901088
@@index([runTags(ops: ArrayOps)], type: Gin)
10911089
@@index([runtimeEnvironmentId, batchId])

0 commit comments

Comments
 (0)