Neo4j Query Log Analyzer and DB Analyzer updated for Neo4j 4.0

Kees Vegter
Jan 30 · 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

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:

Multi-database

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:

This query is executed 27 times on database, neo4j

Database connection

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

Explain Plan

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.

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

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.

Current Queries

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.

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

Query Stats

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.

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

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.

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…

Kees Vegter

Written by

Neo4j Developer Blog

Developer Content around Graph Databases, Neo4j, Cypher, Data Science, Graph Analytics, GraphQL and more.

More From Medium

More from Neo4j Developer Blog

More from Neo4j Developer Blog

More from Neo4j Developer Blog

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade