cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Execution time of cypher query

Hi,
Thnx in advance if anyone help me with this.
I am trying to compare the execution times of RDBMS and Neo4j Queries, how can I get the execution time in Neo4j.

5 REPLIES 5

If you have enterprise edition, you can turn on query logging, and if you like you can also enable additional options to track how the time is distributed throughout the execution process.

Keep in mind that at least the first run of the query may be slower than subsequent runs, as the query will have to be planned, and the part of the graph touched may not be in the pagecache. We recommend discarding the first execution time, then running the query a few times to get the min or average, depending on what you're going for.

Also you'll want to make sure you have indexes (or unique constraints) in place to support fast lookup of your starting nodes.

In neo4j, there are two options to choose from when you want to analyze a query. It is explain and profile. I think you should take a look at those links:
https://neo4j.com/docs/cypher-manual/current/query-tuning/how-do-i-profile-a-query/
https://neo4j.com/docs/cypher-manual/current/query-tuning/basic-query-tuning-example/
https://neo4j.com/docs/cypher-manual/current/execution-plans/
to determine the execution time of a query in neo4j.

clem
Graph Steward

BTW, there are lots of tricks/techniques to optimize Cypher Queries.

See:

Hello mates
I'm trying to find the execution time of GDS algorithms using community edition of Neo4j. Is there any way to find it rather than query logging? Since this facility is specific to enterprise edition as shown in this topic.
I found this site [neo4j - How to get the execution time of a cypher query from python? - Stack Overflow] is it helpful ??
Update:
Can I rely on this to estimates query execution time?
Note: this is an example of executing shortest path algorithm:
3X_3_7_37259410da7a94c7163e5fe5e5bbc1f0be2399db.png