Skip to content

Commit dd78dd9

Browse files
authored
perf(webapp): select only needed columns in dev current-worker lookup (#4621)
## Summary When resolving the current worker for a development environment, `findCurrentWorkerFromEnvironment` loaded the entire `BackgroundWorker` row, including the large `metadata` JSON, even though it only ever returns a handful of small fields. It is a frequently-run query, so the wasted payload adds up: every call pulled data it immediately threw away. ## Fix Add a `select` to the development-environment lookup listing exactly the fields the function returns (`id`, `friendlyId`, `version`, `sdkVersion`, `cliVersion`, `supportsLazyAttempts`, `engine`). The query plan is unchanged, still a single-row indexed lookup; only the row width shrinks. No behavior change: the dropped columns were never read.
1 parent 8dc8e1b commit dd78dd9

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

apps/webapp/app/v3/models/workerDeployment.server.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,15 @@ export async function findCurrentWorkerFromEnvironment(
209209
where: {
210210
runtimeEnvironmentId: environment.id,
211211
},
212+
select: {
213+
id: true,
214+
friendlyId: true,
215+
version: true,
216+
sdkVersion: true,
217+
cliVersion: true,
218+
supportsLazyAttempts: true,
219+
engine: true,
220+
},
212221
orderBy: {
213222
createdAt: "desc",
214223
},

0 commit comments

Comments
 (0)