-
Type:
Task
-
Resolution: Won't Do
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
Summary
Audit the default MongoDB indexes by the domain (workflows, observability, scores, background-tasks, etc).
Background
The memory domain recently identified an optimization path for default indexes that will trim them from 15 to 9 by matching them to the actual queries the system runs (see audit). The same audit has not yet been done for the other domains. Additionally, the memory domain will be updated to fail loudly if an index cannot be created (see here), so problems are visible immediately; but the other domains still silently swallow those errors.
Tasks
- Review every query in each domain and list the fields it filters and sorts by.
- Remove any default indexes that are redundant (already covered by a compound index) or unused.
- Add any indexes that are missing for queries that currently do full table scans.
- Update index-creation to fail loudly on error, matching the memory domain behaviour.
Why it matters
- Performance: Redundant indexes slow down every write. Missing indexes slow down reads as data grows.
- Reliability: Silent index-creation errors mean the system may run without indexes and nobody notices until queries become slow.
Acceptance Criteria
- Document audit results
- Create a follow up tickets to optimize each domain