Hi,

I am trying to form a query where I want to know friends of a person A and 
their inter-relationships but no one should be present who is not directly 
a friend of A. For e.g.,

MATCH (A:person {id:xyz})-[r1:KNOWS]->(B:person) RETURN A as node_start, B 
as node_end 
UNION MATCH (C:person 
{id:xyz})-[r2:KNOWS]->(D:person)-[r3:KNOWS]->(E:person) 
WHERE (C)-->(E) RETURN  D as node_start, E as node_end

Again, trying to find out friends of a person and if any of the friends 
also KNOW each other but dont' want to introduce any friends of friends 
whom the person doesn't directly KNOW yet.

The query performs really bad above even with indexing on id (which is an 
integer) for the person. Very small data set works but in one case A has 
3814 relationships and one of the B's has 44000 relatioinship, the query 
never returns..

Any hints suggestions - I have tried various variations of it using collect 
for the first part or anything but as soon as we enter the UNION or the 2nd 
phase of query it just never returns with the above number of 
relationships..

It would be good if I can perhpas pass in the collected id's as a list from 
the 1st part to the match clause in 2nd or to the lucene index ..

Thanks,

- Zeeshan

-- 
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/groups/opt_out.

Reply via email to