Cypher query optimizations

In this section, we will talk about the various utilities, features, tips, and tricks available and provided by Neo4j to improve the performance of our Cypher queries.

Before moving forward, let's clean up our database once again and recreate our sample dataset.

Perform the following steps to clean up your Neo4j database:

  1. Open your Linux console or shell and execute "<$NEO4J_HOME>/bin/neo4j-shell".
  2. Execute the following Cypher queries to delete the data from Neo4j database.
    MATCH (n)-[r]-(n1) delete r,n.n1;
    MATCH n delete n;

Next, recreate the sample dataset provided in the Pattern and pattern matching section of Chapter 2, Querying the Graph with Cypher.

Further in this section, we will refer to the data created by our sample ...

Get Building Web Applications with Python and Neo4j now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.