Repository navigation
Commit b50bd12
perf(ownership): Fetch only the latest assignment activity (#128144)
Autoassignment checked `if activity:` on the assignment history
queryset, which loaded every ASSIGNED activity for the group just to
read the newest one. Use `.first()` so it only fetches one row.
Same query count, but it was returning about 78M rows/day in US for 38M
executions, so roughly half of those rows go away, pretty small thing.
Also adds `-id` as a tiebreaker, matching the smart assignment scoring
query.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent 0ded594 commit b50bd12
1 file changed
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
350 | 352 | | |
351 | 353 | | |
352 | 354 | | |
| |||
0 commit comments