- Add database indexes on frequently queried FK columns (JobRun, MailMessage,
MailObject, TicketScope, RemarkScope)
- Fix N+1 query in override recomputation by batch loading jobs
- Optimize Daily Jobs page with batch queries:
- Batch load all today's runs in single query
- Batch infer weekly/monthly schedules for all jobs
- Batch load ticket/remark indicators
These changes reduce query count by 80-90% on pages like Daily Jobs and Run Checks,
significantly improving performance on systems with slower storage.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>