Neo4j Query Log Analyzer and DB Analyzer updated for Neo4j 4.0

Kees Vegter
Jan 30, 2020 · 4 min read

With the release of Neo4j 4.0 my ‘Graph Apps’ for the Neo4j Desktop needed an update. The new Neo4j version, is a very big update with a lot of new features. An important feature is multi-database where you can run more than one graph database on a Neo4j Server.

You can install both apps into Neo4j desktop from: https://install.graphapp.io

Image for post
Image for post

Query Log Analyzer 1.0.1

The first version of this tool as described here was able to analyze an uploaded query.log file. I also gave a presentation at NODES 2019

NODES 2019 presentation

With this new version the following new features are added:

The Neo4j version 4 capability to run multiple databases leads to extra information in the query log file. You can now see in the query log on which database the query was executed. This will now be displayed in the tool:

Image for post
Image for post
This query is executed 27 times on database, neo4j

In this version of the Query Log Analyzer, a connection to database is made which makes the following functions available:

  • Explain Plan
  • Current Queries
  • Query Stats

When you have a Query displayed (less than 10000 characters) in the tool you can start a “Explain Plan” of this query by pressing the following icon.

Image for post
Image for post

After clicking, a Query Details screen will be shown with the Query Plan in it.

Image for post
Image for post
You can zoom in zoom out on the plan, the current selected step Procedure Call is shown at the right. When you click Next, you jump to the next Query Planning step.

With the color of the ‘Step’ you can see if the step is expensive or not, so things like All Nodes Scan or Full Label Scan are in red. The Explain Plan will be executed on the database where the query was executed on.

With this function it is possible to show the current running queries on the database. In the figure below you see a screenshot when working with version 4 of the Neo4j database. Per database you can list the current running queries.

Image for post
Image for post
Here is a connection to a version 4 database which runs two databases, neo4j and base1

Since version 3.5.4 the database collects the query statistics for the last 8192 invocations and keeps that in memory. This is a great way to see what the latest load was on the server. If you want to fine tune your queries you have here the query times in micro seconds (the query log uses milliseconds). This also works when the query logging to file is switched off.

Image for post
Image for post
Image for post
Image for post

When you click on the timeline icon, you can see the Invocation Time Line for this query.

Image for post
Image for post

Neo4j Database Analyzer 1.0.1

The main change in this tool is that can handle multiple databases on a Neo4j server version 4. You will now have a tab per database. The functionality of the Neo4j Database Analyzer is described in the introduction of this tool.

Image for post
Image for post
The tool is connected to a Neo4j version 4 database, where two databases, neo4j and base1 are running.

Resources

The source code for the Query Log Analyzer is on Github at kvegter/query-analyzer-app. There you can read the documentation and report issues.

The source code for the Neo4j db Analyzer is on Github at kvegter/dbreportapp. There you can read the documentation and report issues.

If you have questions regarding the query performance, you can always head to the #help-cypher channel on the Neo4j Users Slack or on the neo4j community.

Neo4j Developer Blog

Developer Content around Graph Databases, Neo4j, Cypher…

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store