Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

perf(coderd/database): limitGetLatestWorkspaceAppStatusByAppID to 1 row#20917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mafredri merged 4 commits intomainfromfix-github-issue-20862
Nov 25, 2025

Conversation

@mafredri
Copy link
Member

@mafredrimafredri commentedNov 25, 2025
edited
Loading

Description

This PR fixes an issue whereGetLatestWorkspaceAppStatusesByAppID returned an unbounded number of rows for a given app ID, which could cause performance issues for noisy or long-running AI tasks.

Changes

  • RenamedGetLatestWorkspaceAppStatusesByAppID toGetLatestWorkspaceAppStatusByAppID (singular)
  • Changed SQL query from:many to:one
  • AddedLIMIT 1 to the SQL query to only fetch the most recent status
  • Updated all usages to handle a single result instead of a slice
  • Changed empty result checks fromlen(latestAppStatus) == 0 tolatestAppStatus.ID == uuid.Nil

Impact

This change reduces database query overhead for workspace app status updates, particularly for long-running AI tasks that update their status frequently. Previously, fetching the latest status would return all historical statuses; now it returns only the most recent one.

Fixes#20862


🤖 PR was written by Claude Sonnet 4.5 Thinking usingmux and reviewed by a human 🏄🏻‍♂️.

GetLatestWorkspaceAppStatusesByAppID returned all app statuses for agiven app ID, which could be unbounded for long-running AI tasks. Onlythe most recent status was used, so we now:- Rename query to GetLatestWorkspaceAppStatusByAppID (singular)- Change query type from :many to :one- Add LIMIT 1 to SQL query- Update usages to handle single result instead of sliceFixes#20862---🤖 PR was written by Claude Sonnet 4.5 Thinking and reviewed by a human 🏄🏻‍♂️.
@mafredrimafredri changed the titlefix(database): limit GetLatestWorkspaceAppStatusByAppID to 1 rowperf(coderd/database): limitGetLatestWorkspaceAppStatusByAppID to 1 rowNov 25, 2025
@mafredrimafredri marked this pull request as ready for reviewNovember 25, 2025 13:49
@mafredrimafredri merged commit37fc664 intomainNov 25, 2025
32 checks passed
@mafredrimafredri deleted the fix-github-issue-20862 branchNovember 25, 2025 14:56
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsNov 25, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@DanielleMaywoodDanielleMaywoodDanielleMaywood approved these changes

@spikecurtisspikecurtisAwaiting requested review from spikecurtis

Assignees

@mafredrimafredri

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

bug: GetLatestWorkspaceAppStatusesByAppID returns an unbounded number of rows

3 participants

@mafredri@DanielleMaywood

[8]ページ先頭

©2009-2025 Movatter.jp