perf(api): batch ranking candidate-face lookups and defer person-side scans #1089
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/person-ranking-picker-latency"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Opening the "choose an existing person" picker in discovery suggestions showed "Loading people…" for seconds. Measured against the live DB:
personRankingissued per-face SQL (N+1): up to 391 faces × ~4.2 ms = 1.6–3.3 sFix
WHERE face_id IN (...)chunks (RANKING_IN_CHUNK_SIZE) instead of one query per face.ADR 0109 multi-representant pessimistic ranking semantics are preserved exactly — no test tolerances were loosened.
Verification
rtk ./gradlew :apps:api:test→ BUILD SUCCESSFUL, 144 suites / 1672 tests / 0 failures / 9 skipped (incl.PgVectorEmbeddingPostgresTest6/6,ClassInstanceDiscoveryServiceTest291/291)807852a9).Scope / follow-ups
[ISSUE-111]islow/openand honestly scoped: onlymergeSuggestioncan change an outcome;mergeTargetRankingsonly over-fetches.embeddingKnnServicefield,stashed_at IS NULLfilter inconsistency, two stale single-centroid comments.