Book Image

Building web applications with Python and Neo4j

By : Sumit Gupta
Book Image

Building web applications with Python and Neo4j

By: Sumit Gupta

Overview of this book

Table of Contents (14 chapters)
Building Web Applications with Python and Neo4j
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 dataset and will also explain the process of performance tuning/optimization.

Indexes

Neo4j 2.0 introduces an optional schema, based on the concepts of labels. You can define the constraints and indexes on the labels. This in turn helps in implementing...