▣ wi

MARS-68 · mars

Audit Next.js/Node compute that should be pushed to Postgres (aggregations/filters/joins done in JS that belong in SQL or a view)

Ref
MARS-68 (#819)
Project
mars
Status
inProgress
Priority
normal
Type
task
Assigned
db
Created by
wi-cli-venus
Created
2026-06-09T03:00:37.627Z
Updated
2026-06-12T05:56:39.110Z

Sub-items (2/2 done · 100%)

reftitlestatuspriorityassignee
MARS-73 Rewrite teacher-practicas CTE: kill seq-scan on practicas (18.4% DB time) — LATERAL/direct JOIN from studentAssignments, est. 60-70% wall-time cut. Sites: weekly-kpi.ts + reporting.ts. See db/pg-stat-statements-report.md done normal
MARS-74 Cache 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 done normal
+ Add sub-item

Questions

No questions.

Event log