# Neo4j query performance

**URL:** <https://community.neo4j.com/t/neo4j-query-performance/62050>\
**Category:** Cypher\
**Tags:** performance\
**Created:** [April 14, 2023, 7:27am UTC](https://community.neo4j.com/t/neo4j-query-performance/62050 "2023-04-14T07:27:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anshulchaintha7](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/anshulchaintha7/32/27878_2.png) [@anshulchaintha7](https://community.neo4j.com/u/anshulchaintha7)\
**Post date:** [April 14, 2023, 7:27am UTC](https://community.neo4j.com/t/neo4j-query-performance/62050/1 "2023-04-14T07:27:57Z")

</div>

What is the easiest way to gather performance of database in Neo4j?

---

<div class="post-metadata">

**Author:** ![elaine\_rosenber](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/elaine_rosenber/32/27409_2.png) [@elaine\_rosenber](https://community.neo4j.com/u/elaine_rosenber)\
**Post date:** [April 14, 2023, 3:47pm UTC](https://community.neo4j.com/t/neo4j-query-performance/62050/2 "2023-04-14T15:47:22Z")

</div>

Hello @anshulchaintha7 ,

You should make a list of the most important queries.

Then you should PROFILE there to observe db hits and elapsed time. Make sure that you execute each query at least twice as the first execution compiles the query.

You may need to:

1. Rewrite your queries to make them more efficient.
2. Add indexes to the graph.
3. Refactor your graph which would require you to rewrite your queries.

Then there are things such a warming up to page cache to make sure as much of the graph is in memory as possible and also playing with the VM settings for the graph.

Take as look at the performance section of the Operations Manual.

> **[Performance - Operations Manual](https://neo4j.com/docs/operations-manual/current/performance/)**
>
> This chapter describes factors that affect operational performance, and how to tune Neo4j for optimal throughput.

---

<div class="post-metadata">

**Author:** ![Cobra](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/cobra/32/35243_2.png) [@Cobra](https://community.neo4j.com/u/Cobra)\
**Post date:** [April 15, 2023, 9:46am UTC](https://community.neo4j.com/t/neo4j-query-performance/62050/3 "2023-04-15T09:46:37Z")

</div>

Hello @anshulchaintha7 🙂

You can also install [Neo4j Ops Manager](https://neo4j.com/docs/ops-manager/current/introduction/overview/).

Best regards,  
Cobra

---

<div class="post-metadata">

**Author:** ![anshulchaintha7](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/anshulchaintha7/32/27878_2.png) [@anshulchaintha7](https://community.neo4j.com/u/anshulchaintha7)\
**Post date:** [April 18, 2023, 4:54am UTC](https://community.neo4j.com/t/neo4j-query-performance/62050/4 "2023-04-18T04:54:02Z")

</div>

Thanks Elaine and Cobra.  
Any monitoring tool for Neo4j community edition?

---

<div class="post-metadata">

**Author:** ![elaine\_rosenber](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/elaine_rosenber/32/27409_2.png) [@elaine\_rosenber](https://community.neo4j.com/u/elaine_rosenber)\
**Post date:** [April 18, 2023, 1:28pm UTC](https://community.neo4j.com/t/neo4j-query-performance/62050/5 "2023-04-18T13:28:31Z")

</div>

Not that I know of, unless another community member has written one.

---

<div class="post-metadata">

**Author:** ![anshulchaintha7](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/anshulchaintha7/32/27878_2.png) [@anshulchaintha7](https://community.neo4j.com/u/anshulchaintha7)\
**Post date:** [April 21, 2023, 11:26am UTC](https://community.neo4j.com/t/neo4j-query-performance/62050/6 "2023-04-21T11:26:25Z")

</div>

Hello @Cobra  
Is there any workaround so that I can get time of query execution in ms?  
As of now I am noting query time in integers as per desktop version.  
I want to collect the exact time in decimals.

---

<div class="post-metadata">

**Author:** ![Cobra](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/cobra/32/35243_2.png) [@Cobra](https://community.neo4j.com/u/Cobra)\
**Post date:** [April 23, 2023, 9:17am UTC](https://community.neo4j.com/t/neo4j-query-performance/62050/7 "2023-04-23T09:17:50Z")

</div>

Hello @anshulchaintha7 🙂

If you use a Neo4j connector, you can get the timestamp before sending the query and after the result is returned then make a subtraction. For example, in Python you can use the time library to do it. This will give you a good approximation.

Best regards,  
Cobra
