Hi there,

I have been trying to solve this bizarre problem for a day now and I can't 
figure it out. I have the following cypher:


MATCH (a:A{email:"[email protected]"})
OPTIONAL MATCH (a)-[r1:r1]-()
OPTIONAL MATCH (a)-[r2:r2]-()
OPTIONAL MATCH (a)-[r3:r3]-() 
OPTIONAL MATCH (a)-[r4:r4]-() 
OPTIONAL MATCH (a)-[r5:r5]-()
OPTIONAL MATCH (a)-[r6:r6]-()
OPTIONAL MATCH (a)-[problem:r7]-()
RETURN a, r1, r2, r3, r4, r5, r6, r7


There is a unique constraint on A:email. All the other nodes have unique 
constraints too (usually on a uuid).

So I am using the REST API and passing in: 

"resultDataContents":["graph"]

This is to minimise the data sent over the wire and because I map the 
results to my domain objects. row based/jdbc sends way too much data and 
can't return properties on relationships AFAIK.

The problem i'm having is that by including the relationship problem:r7 my 
cypher query goes from around 1sec (without it) to around 40 sec (with it). 
The total data it needs to return is about 100-150 nodes.

I have ordered the relationships in order of reducing cardinality to make 
searching easier. If i do a count distinct return query for 
a:A-[problem:r7]-() the query returns in about 120ms.

Does anyone have any ideas? Also it might matter but it might not: I have 
upgraded the db several times from 2.1.3 -> 2.1.4 -> 2.1.5.



-- 
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