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
{{ message }}
Repository navigation
bug: GetLatestWorkspaceAppStatusesByAppID returns an unbounded number of rows #20862
GetLatestWorkspaceAppStatusesByAppID returns all app statuses ever written for the given app. This could be quite large for a long running AI task.
Only the first (most recent) status is ever used at present, to determine whether the WorkspaceAppStatusState is changing while inserting a new status update.
Relevant Log Output
Expected Behavior
No response
Steps to Reproduce
Run an AI task that updates status more than once.
Activity
mafredri commentedon Nov 21, 2025
Nice find, this seems like an easy win as the query only used in one place.
GetLatestWorkspaceAppStatusesByAppID->GetLatestWorkspaceAppStatusByAppIDand change:many->:oneLIMIT 1Slack thread for context: https://codercom.slack.com/archives/C05D8G51P8Q/p1763726141970759
perf(coderd/database): limit `GetLatestWorkspaceAppStatusByAppID` to …
perf(coderd/database): limit `GetLatestWorkspaceAppStatusByAppID` to …