Hello!
I need help with a query that is very slow.
My data models:
2379k categories (vertex)
1746315k users (vertex)
376900k products (vertex)
40m views (client -> view (date) -> product)
2m belong (product -> belong -> category)
I want to display recommendations from "Who view also view:
I have two basic queries, one with category filter and one without.
Query without filter:
MATCH (p: Product {idProduct: "178293"}) <- [: VIEW] - (c: Customer) - [: VIEW]
RETURN rec.idProduct AS recommendation, COUNT (*) AS views
ORDER BY views DESC LIMIT 25
It's taking about 10 seconds to run.
Query with filter:
MATCH (p: Product {idProduct: "178293"}) <- [: VIEW] - (c: Customer) - [: VIEW] "173"})
RETURN rec.idProduct AS recommendation, COUNT (*) AS usersWhoAlsoWatched
ORDER BY usersWhoAlsoWatched DESC LIMIT 25
It's taking about 60 seconds to run.
I would like to receive some tips to tune this query.
Thank you!