perf: cut MongoDB scans in repository workflows (#780)

* Add repository name index

* Optimize repository file counts

* Optimize MongoDB query workloads
This commit is contained in:
Thomas Durieux
2026-08-20 12:29:26 +02:00
committed by GitHub
parent a30457993d
commit 7aa9557905
12 changed files with 124 additions and 61 deletions
+1 -1
View File
@@ -196,7 +196,7 @@ router.get(
const repoId = repo.repoId;
const results = await FileModel.aggregate([
{ $match: { repoId, size: { $ne: null } } },
{ $project: { path: 1 } },
{ $project: { _id: 0, path: 1 } },
{ $group: { _id: "$path", count: { $sum: 1 } } },
]).exec();