0

Hi everyone I have created a collaborative-filtering algorithm in opencypher (memgraph). Although my coworker says that it would not scale to high demands is this the case? if so how would I make it more scalable

MATCH (user:User)-[:CLICKED_ON]->(p:Post)<-[:CLICKED_ON]-(otherUser:User)
WHERE user.username = $username AND p.timestamp >= datetime() - duration({months: 3})
WITH COLLECT(DISTINCT otherUser) AS others, COLLECT(DISTINCT p) AS sharedProds, user AS u
UNWIND others AS other
MATCH (other)-[:CLICKED_ON]->(recommended:Post)
WHERE NOT recommended IN sharedProds AND NOT (u)-[:VIEWED]->(recommended)
RETURN DISTINCT recommended.postId, count(DISTINCT other) as frequency
ORDER BY frequency DESC
cybersam
  • 63,203
  • 6
  • 53
  • 76
  • 1
    This question needs to provide more information to avoid being closed by the community. Please add more information to your question, including: (1) What is your data model and use case?; (2) What are your colleague's exact concerns with your query?; (3) What performance testing have you already performed and what were the results? Also, your question was mistitled and mislabelled, since it is for `memgraph`, which is not `neo4j` and does not use full `cypher`. I have fixed that. – cybersam Aug 07 '23 at 17:26

0 Answers0