简体   繁体   中英

Neo4j cache and performance

I'm testing a query in neo4j and I see that when I clear the cache . Neo4j takes more time to load . which mean performances are dicreasing . Why is this happening I don't know now whether to clear the cache for each query ? or should I just test without clearing the cache

Neo4j browser doesn't cache any data from a query. So clearing your browser cache has no incidence on the query execution time.

Perhaps the browser is creating a new connection to the database, makes some computations (like colors for nodes for example), etc.

To see the query execution time, on the query panel, select the row result, and take a look at the bottom. You should see something like that : Started streaming 50 records after 2 ms and completed after 12 ms. The 2 ms is your query execution time.

If you want to optimize / see the performance of a query, I recommend you to use the EXPLAIN and PROFILE .

FYI, Neo4j has two caches :

  • the one for the data -> pagecache. Neo4j put in RAM its data files, so to access them is fast
  • the one for query execution plan -> if you are using parameterised queries, Neo4j doesn't re-computing the query plan if it already has it

Cheers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM