Help with query

25 views
Skip to first unread message

Rodrigo Lacerda

unread,
Mar 17, 2018, 8:21:30 PM3/17/18
to Neo4j
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!

Michael Hunger

unread,
Mar 26, 2018, 9:10:19 PM3/26/18
to ne...@googlegroups.com
Somehow your query is not showing correctly.
Can you send them again? And check that they render correctly?

Are you using Neo4j enterprise? And what is your machine setup + memory config
How big is your db on disk?

I would filter out nodes (customers) above and below a certain view count.

Do you have indexes / constraints on :Product(idProduct) and :Customer(idCustomer) ?





--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages