I need a way to speed up my query, not sure if this is the right way but 
this is how I did it and very slow:

1. identify Anonymous-Users with last actions on 18 May 

MATCH 
(u:Anonymous-Users)-[r:INQUIRY_ON|VIEW]->(p:Product)-[:BELONG_TO]->(l4:Category)
with u as u, head(collect(r.traffic_ts)) as headts, head(collect(p.id)) as 
headp, head(collect(l4)) as headl4 order by u.cookie
WHERE (headts > 1463500800000  and headts < 1463587200000) // this is 
millisecond time
return u.cookie, headp, headl4 order by u.cookie;

there are 4,000,000 Anonymous-Users in DB so running this first cypher has 
taken like 20 mins to return 32,898 rows

2. after identifying Anonymous-Users cookie the goal is to return User 
details who are Registered-Users, below is the extended version:


MATCH 
(u:Anonymous-Users)-[r:INQUIRY_ON|VIEW]->(p:Product)-[:BELONG_TO]->(l4:Category)
with u as u, head(collect(r.traffic_ts)) as headts, head(collect(p.id)) as 
headp, head(collect(l4)) as headl4 order by u.cookie
WHERE (headts > 1463500800000  and headts < 1463587200000) // this is 
millisecond time
with u.cookie as ucookie, headp as headp, headl4 as headl4 order by u.cookie
match (b:Registered-Users) 
where has(b.nvu_cookie_id) and b.nvu_cookie_id = ucookie
return b.id, b.desc;

we have 600,000 Registered Buyer, and this cypher is running forever and 
never return

I believe there's a smarter way doing this?

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to