From f97d24402e71a4379313a9e235a7a44451f46d80 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Wed, 26 Nov 2025 16:33:10 +0100 Subject: [PATCH] Update todo --- backend/api/src/get-profiles.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/api/src/get-profiles.ts b/backend/api/src/get-profiles.ts index 8a72f74d..8c96c31f 100644 --- a/backend/api/src/get-profiles.ts +++ b/backend/api/src/get-profiles.ts @@ -84,7 +84,9 @@ export const loadProfiles = async (props: profileQueryType) => { const keywords = name ? name.split(",").map(q => q.trim()).filter(Boolean) : [] // console.debug('keywords:', keywords) - // TODO: do this in SQL for better performance + // TODO: do this in SQL for better performance. Precompute compatibility scores: + // - Have a table compatibility_scores(user_id_1, user_id_2, score) that updates whenever answers from either user change. + // - Query this table directly with "ORDER BY score DESC LIMIT {limit}". if (orderByParam === 'compatibility_score') { if (!compatibleWithUserId) { console.error('Incompatible with user ID')