Relationships
#3927 Profile showcase read: approved list sorts on review.reviewedAt in memory
Opened by keeb · 10/25/2026
lib/infrastructure/mongo-showcase-repository.ts listByOperative (added in #1412), on the approved-only branch the profile page uses, sorts on review.reviewedAt. The index { operativeId: 1, status: 1, createdAt: -1 } narrows the read to the operative's approved showcases, then MongoDB sorts those in memory.
This is on the hot profile path, but approved showcases per operative are inherently few (each needs an admin approval, and the profile reads at most six), so the in-memory sort is negligible. No action needed unless showcases per operative grow meaningfully. At that point, either index { operativeId: 1, status: 1, "review.reviewedAt": -1 } or sort the approved list on a field the existing index already covers.
Open
No activity in this phase yet.
Sign in to post a ripple.