You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Batch triggers that pass per-item idempotency keys could take seconds when the
target task had a large run history, because the bulk `idempotencyKey IN (...)`
lookup degraded to scanning every run for the (environment, task) pair and
filtering in memory. Look each key up individually via a chunked UNION ALL of
point lookups so the planner always uses a per-key index probe.
Speed up idempotency checks on `batchTrigger` calls that use idempotency keys. Large batches against a task with a big run history no longer degrade to multi-second lookups.
Prisma.sql`SELECT "friendlyId", "idempotencyKey", "idempotencyKeyExpiresAt" FROM "TaskRun" WHERE "runtimeEnvironmentId" = ${args.runtimeEnvironmentId} AND "taskIdentifier" = ${args.taskIdentifier} AND "idempotencyKey" = ${key}`
1697
+
);
1698
+
returnprisma.$queryRaw<IdempotencyKeyRunMatch[]>(Prisma.join(branches," UNION ALL "));
0 commit comments