Commit 37fc664
authored
perf(coderd/database): limit
## Description
This PR fixes an issue where `GetLatestWorkspaceAppStatusesByAppID`
returned an unbounded number of rows for a given app ID, which could
cause performance issues for noisy or long-running AI tasks.
## Impact
This change reduces database query overhead for workspace app status
updates, particularly for busy 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
---
🤖 This change was written by Claude Sonnet 4.5 Thinking using [mux](https://github.com/coder/mux) and reviewed by a human 🏄🏻♂️GetLatestWorkspaceAppStatusByAppID to 1 row (#20917)1 parent 5213023 commit 37fc664
File tree
8 files changed
+45
-56
lines changed- coderd
- database
- dbauthz
- dbmetrics
- dbmock
- queries
8 files changed
+45
-56
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2426 | 2426 | | |
2427 | 2427 | | |
2428 | 2428 | | |
2429 | | - | |
| 2429 | + | |
2430 | 2430 | | |
2431 | | - | |
| 2431 | + | |
2432 | 2432 | | |
2433 | | - | |
| 2433 | + | |
2434 | 2434 | | |
2435 | 2435 | | |
2436 | 2436 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2864 | 2864 | | |
2865 | 2865 | | |
2866 | 2866 | | |
2867 | | - | |
| 2867 | + | |
2868 | 2868 | | |
2869 | | - | |
| 2869 | + | |
2870 | 2870 | | |
2871 | 2871 | | |
2872 | 2872 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
391 | | - | |
| 391 | + | |
392 | 392 | | |
393 | | - | |
394 | | - | |
| 393 | + | |
| 394 | + | |
395 | 395 | | |
396 | | - | |
| 396 | + | |
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
| 401 | + | |
401 | 402 | | |
402 | 403 | | |
403 | 404 | | |
| |||
442 | 443 | | |
443 | 444 | | |
444 | 445 | | |
445 | | - | |
| 446 | + | |
446 | 447 | | |
447 | 448 | | |
448 | 449 | | |
| |||
492 | 493 | | |
493 | 494 | | |
494 | 495 | | |
495 | | - | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
496 | 499 | | |
497 | 500 | | |
498 | 501 | | |
499 | 502 | | |
500 | 503 | | |
501 | 504 | | |
502 | | - | |
| 505 | + | |
503 | 506 | | |
504 | 507 | | |
505 | 508 | | |
| |||
0 commit comments