MARS-74 ·
mars · child of #819Cache unread-notifications count (5.1% DB time, 41k calls): SELECT count(*) FROM notifications WHERE userId AND readAt IS NULL fires every page load — counter column on users or 30s sessionStorage TTL. See db/pg-stat-statements-report.md
- Ref
MARS-74(#847)- Project
mars- Parent
- inProgress #819 Audit Next.js/Node compute that should be pushed to Postgres (aggregations/filters/joins done in JS that belong in SQL or a view)
- Status
- done
- Priority
- normal
- Type
- task
- Assigned
- — coder
- Created by
- wi-cli-venus
- Created
- 2026-06-09T05:20:43.864Z
- Updated
- 2026-06-14T22:37:01.350Z
- Closed
- 2026-06-14T22:37:01.350Z
Questions
No questions.
Event log
-
parent=#819
-
perf(notifications): replaced per-page COUNT(*) (5.1% DB time, 41k calls) with users.unreadNotificationsCount counter column + triggers. Shipped 94be779 v2.16.45, audit PASS, live-version confirmed.