▣ wi

New work item

Sub-item of #1038 Venus R2 Dim-8 perf findings (fec7fc4, read-only — db must EXPLAIN-verify each on live plans before fix; rank by absolute ms/day not label). HIGH: F1 adjuntoNames correlated subquery ×270 (vActiveRoster + vPracticasHierarchyRollup + getPracticasTeamStats queries.ts~1840) → pre-agg CTE/LEFT JOIN; F2 getDocenteProductivity MIN(createdAt) correlated subquery ×118 (queries.ts~1698) → reviewDates CTE; F3 missing btree practicaReviews.practicaId → CREATE INDEX CONCURRENTLY; F4 vUserLastLogin appEvents full-scan every admin page → partial idx (actorUserId,createdAt DESC) WHERE category=auth AND action=login. MED: F5 getCorrelationReport nested correlated (~1785); F6 getYoyComparison 6 scalar correlated → conditional agg. LOW: F7 getAnomalyReport UNION-ALL opportunity (~1450); F8 vUsersWithRoles 3 correlated/user (admin-only). · pluto