# Performance Review — M11

## Hot queries reviewed

1. Adaptive next-question:
   - questions(status, skill_id, difficulty, published_at)
   - question_exposure_logs(student_profile_id, question_id, shown_at)

2. Student attempts:
   - student_question_attempts(student_profile_id, question_id, answered_at)

3. Dashboard/reporting:
   - student_daily_activity(student_profile_id, activity_date, questions_answered)
   - test_sessions(student_profile_id, submitted_at)
   - student_attendance(student_profile_id, attendance_date)

4. Parent / school dashboards:
   - keep aggregates out of request path where possible
   - use report snapshots for larger organizations

## Caching candidates
- taxonomy
- published test metadata
- subscription plan list
- school dashboard snapshots
- static system settings

## Queue-required workloads
- PDF/image imports
- AI extraction
- email
- parent weekly reports
- organization snapshots
- heavy analytics

## Production recommendations
- Redis for cache + queue when traffic grows
- MySQL slow query log
- EXPLAIN on top 20 production queries
- pagination on all list endpoints
- avoid eager-loading huge message/history collections
