fix: remove repeated queries from source cards and dashboard #47
Reference in New Issue
Block a user
Delete Branch "feature/mostovik-dashboard-performance"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Source cards waited 13 seconds because the latest background job was searched again for each historical row. Select latest jobs once on PostgreSQL, reuse dashboard source matches, and count staged snapshot rows only when no saved total exists.
Measured on one read-only dev database snapshot: sources 13.20 → 3.45 s cold and 10.19 → 0.24 s warm; dashboard 4.17 → 2.86 s. Full response payloads match.
Validation: 1773 tests passed, 38 skipped; PostgreSQL targeted suite 108 passed with one unrelated LOWER(date) failure also reproduced on base dev. Ruff, Django check and migration drift checks pass. No migrations or new settings.