Skip to content

Commit f97d244

Browse files
committed
Update todo
1 parent 036776b commit f97d244

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/api/src/get-profiles.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ export const loadProfiles = async (props: profileQueryType) => {
8484
const keywords = name ? name.split(",").map(q => q.trim()).filter(Boolean) : []
8585
// console.debug('keywords:', keywords)
8686

87-
// TODO: do this in SQL for better performance
87+
// TODO: do this in SQL for better performance. Precompute compatibility scores:
88+
// - Have a table compatibility_scores(user_id_1, user_id_2, score) that updates whenever answers from either user change.
89+
// - Query this table directly with "ORDER BY score DESC LIMIT {limit}".
8890
if (orderByParam === 'compatibility_score') {
8991
if (!compatibleWithUserId) {
9092
console.error('Incompatible with user ID')

0 commit comments

Comments
 (0)