harry-potter
harry-potter

Reputation: 2049

Execution time of a Neo4j query

I created this simple example of Neo4j graph:

CREATE (n1:A), (n2:B), (n2:C), (n4:D)
Added 4 labels, created 4 nodes

MATCH(a:A), (b:B), (c:C), (d:D)
CREATE (d)<-[r3:r3]-(a)-[r1:r1]->(b)-[r2:r2]->(c)

Now I made this query on this graph:

MATCH (c:C)<-[r3]-(b:B)<-[r2]-(a:A)-[r1]->(d:D)
RETURN c,d

I did the query 13 times and I get different time of execution:

 1. 72 ms
 2. 68 ms
 3. 81 ms
 4. 25 ms
 5. 44 ms
 6. 22 ms
 7. 24 ms
 8. 53 ms
 9. 45 ms 
10. 67 ms
11. 86 ms
12. 83 ms
13. 90 ms

I'm searching for an inefficient query in Neo4j and I know that Neo4j queries lose their efficient when the oriented graph grows up in deep. I don't understand why the fourth, the sixth and the seventh time the execution time is about 25 ms. Finally, the execution time is reliable? Are queries like this a bit inefficient?

Upvotes: 1

Views: 742

Answers (1)

cybersam
cybersam

Reputation: 67009

I assume you are using a neo4j server. The timing differences you see are very minor and to be expected whenever making requests to any server.

Upvotes: 2

Related Questions