mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-29 14:37:44 +02:00
The runtimes list page renders a CostCell per row that only displays a 7d cost total plus a 7d-vs-prior-7d delta. Until now each cell still fetched a 180d usage window so the cache key matched the runtime-detail page (clicking a row would pre-warm detail). The side effect was N parallel 180d in-line aggregations against task_usage on every list visit, one per runtime, which dominated DB load for this view. Switch the cell to a 14d window — exactly the data it actually needs for cost7d + costPrev7d. Detail still owns its own 180d query; the worst case after this change is one extra request on first navigation into detail, in exchange for a large steady-state reduction on the list page (down to 14d × N instead of 180d × N, ~13× fewer rows scanned per request). This is the frontend half of the runtime-usage perf work tracked in MUL-1748. The backend index + daily rollup changes will land separately. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: multica-agent <github@multica.ai>