Files
anonymous_github/test
Thomas DurieuxandClaude Opus 5.5 24534823a3 perf(db): fix the slowest MongoDB queries from the last 24 hours
MongoDB's slow-query log (24 h, >100 ms) showed four shapes:

- Admin repository search: a case-insensitive substring regex over four
  fields scanned all ~300k repositories, three times per page (up to 5.2 s
  each). Searches that are a repository ID or owner/name now match
  through the indexes first and only fall back to the regex otherwise.
- Admin errors page owner lookup: repoId $in without the repoId index's
  collation was a full collection scan. It now uses the collation.
- Status breakdown and home stats aggregates (~0.4 s over every
  repository, ~100 runs a day from admin polling): cached for a minute,
  and the admin overview uses the existing hourly home-stats cache.
- Folder counts for large repositories (0.7-1.5 s, 400-550k index keys)
  are cached per tree generation, which never changes; legacy trees are
  keyed by commit for 5 minutes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 13:36:17 +00:00
..
2026-05-06 20:00:59 +03:00
2026-07-02 14:53:26 +03:00
2026-05-06 20:00:59 +03:00