SlideShare a Scribd company logo
Craig Taverner
Cypher Team Lead
Performance Improvements
in Neo4j 3.2
Craig Taverner
craig@neo4j.com
@craigtaverner
Craig Taverner
craig@neo4j.com
@craigtaverner
Native Graph Performance Improvements
• Native Label index: Writes now 30-300% faster
• Composite indexes: Faster multi-property queries
• Reachability Queries: Can improve by orders of magnitude
• Compiled Cypher runtime: Speeds queries up to 300%
• Neo4j Browser: Ground-up rewrite yields snappier
performance
Cypher Parser
Performance Improvements in Neo4j 3.2
• Native Label Index

• Composite Indexes

• Compiled Runtime

• Reachability (Pruning Var Expand)

• Solving OR Using Indexes

Cypher Planner
Cypher Runtime
Neo4j Kernel
Storage
CompositeIndexes
Compiled
Native
Label
Index
PruningVXOr
Native Label Index
• New GBPTree Index
• Designed for
concurrent read and
write load
• Performance
• Similar for reads
• Faster for writes
Composite Indexes
Full-stack generalisation of schema indexes to multiple properties
• Cypher:



CREATE  INDEX  ON  :Person(firstname,lastname)

MATCH  (n:Person)

        WHERE  n.firstname  =  'Joe'  AND  n.lastname  =  'Soap'  RETURN  n;

• Core API:



gds.schema().indexFor(Label.label("Person"))

              .on("firstname")

              .on("lastname")

              .create();
Composite Indexes
Cypher queries will use the composite index if the following conditions exist:
• Predicates must exist for all properties in the index and be equality
predicates for the index to be used.
• Predicates for existence, range, starts-with, ends-with and contains will not
be able to use the index (yet).
CREATE  INDEX  ON  :Person(firstname,  lastname);

//  Direct  composite  index  search  on  multiple  property  equality  
MATCH  (n:Person)  WHERE  n.firstname  =  'Joe'  AND  n.lastname  =  'Soap'  RETURN  n;  
//  No  use  of  composite  index  (yet)  
MATCH  (n:Person)  WHERE  n.firstname  =  'Joe'  AND  exists(n.lastname)  RETURN  n;  
MATCH  (n:Person)  WHERE  n.firstname  =  'Joe'  AND  n.lastname  STARTS  WITH  'Soap'  RETURN  n;  
MATCH  (n:Person)  WHERE  n.firstname  =  'Joe'  RETURN  n;  
Composite Indexes
Reachability Queries - Pruning Var Expand
MATCH  (kevin  {name:'Kevin  Bacon'})-­‐[*1..5]-­‐(actor)  
RETURN  DISTINCT  actor
Compiled Runtime
• Coverage
• 50% of Cypher Operators supported
• Cypher Benchmarks Suite 15% supported
• LDBC suite 18% supported
• Does this mean many simple and few complex?

• Performance
• Operators 2x to 20x faster
• Queries … well it depends… let’s say 2x for supported queries
Compiled Runtime - Operators
Compiled Runtime - Operators
Compiled Runtime - LDBC Benchmarks
Compiled Runtime
Solving OR using Indexes
• Consider AND

MATCH (n:X)
WHERE n.firstName = $first AND n.lastName = $last
RETURN n
• Solved with Index and Filter - FAST
• But what happens with OR

MATCH (n:X)
WHERE n.firstName = $first OR n.lastName = $last
RETURN n
• 3.1: Solved with LabelScan and Filter - SLOW
• 3.2: Solved with two IndexSeeks - FAST
Solving OR using indexes
Resources
• Compiled Runtime Coverage
Performance Improvements
in Neo4j 3.2

More Related Content

PDF
Postman tests in jenkins
PDF
Simple cache architecture
PPTX
Welcome Azure Functions 2. 0
PDF
Scaling an invoicing SaaS from zero to over 350k customers
PPTX
State in stateless serverless functions
PDF
React meets o OCalm
PPT
Rubyon Rails
PPTX
AWS re:Invent 2014 talk: Scheduling using Apache Mesos in the Cloud
Postman tests in jenkins
Simple cache architecture
Welcome Azure Functions 2. 0
Scaling an invoicing SaaS from zero to over 350k customers
State in stateless serverless functions
React meets o OCalm
Rubyon Rails
AWS re:Invent 2014 talk: Scheduling using Apache Mesos in the Cloud

What's hot (19)

PDF
Kafka Workshop
PDF
Serverless haskell
PDF
Technology | Serverless
PPT
Scalable Event Tracking
PPTX
Go Training
PDF
[LDSP] Search Engine Back End API Solution for Fast Prototyping
PPTX
Gearman & PHP
PDF
Plaλ!
PDF
[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API
PDF
2019 hashiconf consul-templaterb
PPTX
C# Async on iOS and Android - Miguel de Icaza, CTO of Xamarin
PPTX
DevOps with Azure, Kubernetes, and Helm Webinar
PDF
Salesforce Batch processing - Atlanta SFUG
PPT
Windows Server AppFabric
PPTX
Storage Is Not Virtualized Enough - part 1
PDF
Web Service Testing using TestComplete
PDF
Intelligent infrastructure with SaltStack
PDF
Flink Forward SF 2017: Jamie Grier - Apache Flink - The latest and greatest
PDF
Web Operations101
Kafka Workshop
Serverless haskell
Technology | Serverless
Scalable Event Tracking
Go Training
[LDSP] Search Engine Back End API Solution for Fast Prototyping
Gearman & PHP
Plaλ!
[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API
2019 hashiconf consul-templaterb
C# Async on iOS and Android - Miguel de Icaza, CTO of Xamarin
DevOps with Azure, Kubernetes, and Helm Webinar
Salesforce Batch processing - Atlanta SFUG
Windows Server AppFabric
Storage Is Not Virtualized Enough - part 1
Web Service Testing using TestComplete
Intelligent infrastructure with SaltStack
Flink Forward SF 2017: Jamie Grier - Apache Flink - The latest and greatest
Web Operations101
Ad

Similar to GraphConnect EU 2017 - Performance Improvements in Neo4j 3.2 (20)

PDF
Performance Improvements in Neo4j 3.2
PDF
Walkthrough Neo4j 1.9 & 2.0
PPTX
Introduction to Neo4j and .Net
PDF
Webinar: What's new in Neo4j 2.0
PPT
Hands on Training – Graph Database with Neo4j
PPTX
New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...
PDF
Full Text Search In PostgreSQL
PPTX
The openCypher Project - An Open Graph Query Language
PDF
My cypher query takes too long, what can I do.with links.pdf
PPT
Processing Large Graphs
PDF
GraphConnect 2014 SF: From Zero to Graph in 120: Scale
PDF
Perfect Norikra 2nd Season
PDF
[Srijan Wednesday Webinar] Easy Performance Wins for Your Rails App
PPT
Developing a Culture of Quality Code (Midwest PHP 2020)
PPTX
Hybrid Search with Apache Solr Reciprocal Rank Fusion
PDF
Angular Application Testing
PDF
Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19
PDF
Angular Weekend
PDF
2011-02-03 LA RubyConf Rails3 TDD Workshop
KEY
PTW Rails Bootcamp
Performance Improvements in Neo4j 3.2
Walkthrough Neo4j 1.9 & 2.0
Introduction to Neo4j and .Net
Webinar: What's new in Neo4j 2.0
Hands on Training – Graph Database with Neo4j
New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...
Full Text Search In PostgreSQL
The openCypher Project - An Open Graph Query Language
My cypher query takes too long, what can I do.with links.pdf
Processing Large Graphs
GraphConnect 2014 SF: From Zero to Graph in 120: Scale
Perfect Norikra 2nd Season
[Srijan Wednesday Webinar] Easy Performance Wins for Your Rails App
Developing a Culture of Quality Code (Midwest PHP 2020)
Hybrid Search with Apache Solr Reciprocal Rank Fusion
Angular Application Testing
Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19
Angular Weekend
2011-02-03 LA RubyConf Rails3 TDD Workshop
PTW Rails Bootcamp
Ad

More from Craig Taverner (9)

PDF
The Panama Papers: analysing it with neo4j and neo4j spatial - MINC 2016
PDF
Neo4j and the Panama Papers - FooCafe June 2016
PDF
Neo4j - Managing Distributed Teams
ODP
Neo4j Spatial - FooCafe September 2015
ODP
Neo4j Spatial at LocationDay 2013 in Malmö
ODP
Data Modeling in Telecoms - GraphConnect NY 2013
PDF
Geoprocessing with Neo4j-Spatial and OSM
ODP
Playing on the edge
ODP
Neo4j Spatial - Backing a GIS with a true graph database
The Panama Papers: analysing it with neo4j and neo4j spatial - MINC 2016
Neo4j and the Panama Papers - FooCafe June 2016
Neo4j - Managing Distributed Teams
Neo4j Spatial - FooCafe September 2015
Neo4j Spatial at LocationDay 2013 in Malmö
Data Modeling in Telecoms - GraphConnect NY 2013
Geoprocessing with Neo4j-Spatial and OSM
Playing on the edge
Neo4j Spatial - Backing a GIS with a true graph database

Recently uploaded (20)

PPTX
assetexplorer- product-overview - presentation
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
history of c programming in notes for students .pptx
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
medical staffing services at VALiNTRY
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Nekopoi APK 2025 free lastest update
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPT
Introduction Database Management System for Course Database
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
assetexplorer- product-overview - presentation
VVF-Customer-Presentation2025-Ver1.9.pptx
Designing Intelligence for the Shop Floor.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 41
CHAPTER 2 - PM Management and IT Context
history of c programming in notes for students .pptx
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Design an Analysis of Algorithms II-SECS-1021-03
medical staffing services at VALiNTRY
Operating system designcfffgfgggggggvggggggggg
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Softaken Excel to vCard Converter Software.pdf
Nekopoi APK 2025 free lastest update
Which alternative to Crystal Reports is best for small or large businesses.pdf
Introduction Database Management System for Course Database
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Reimagine Home Health with the Power of Agentic AI​
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)

GraphConnect EU 2017 - Performance Improvements in Neo4j 3.2

  • 1. Craig Taverner Cypher Team Lead Performance Improvements in Neo4j 3.2
  • 3. Native Graph Performance Improvements • Native Label index: Writes now 30-300% faster • Composite indexes: Faster multi-property queries • Reachability Queries: Can improve by orders of magnitude • Compiled Cypher runtime: Speeds queries up to 300% • Neo4j Browser: Ground-up rewrite yields snappier performance
  • 4. Cypher Parser Performance Improvements in Neo4j 3.2 • Native Label Index
 • Composite Indexes
 • Compiled Runtime
 • Reachability (Pruning Var Expand)
 • Solving OR Using Indexes
 Cypher Planner Cypher Runtime Neo4j Kernel Storage CompositeIndexes Compiled Native Label Index PruningVXOr
  • 5. Native Label Index • New GBPTree Index • Designed for concurrent read and write load • Performance • Similar for reads • Faster for writes
  • 6. Composite Indexes Full-stack generalisation of schema indexes to multiple properties • Cypher:
 
 CREATE  INDEX  ON  :Person(firstname,lastname)
 MATCH  (n:Person)
        WHERE  n.firstname  =  'Joe'  AND  n.lastname  =  'Soap'  RETURN  n;
 • Core API:
 
 gds.schema().indexFor(Label.label("Person"))
              .on("firstname")
              .on("lastname")
              .create();
  • 7. Composite Indexes Cypher queries will use the composite index if the following conditions exist: • Predicates must exist for all properties in the index and be equality predicates for the index to be used. • Predicates for existence, range, starts-with, ends-with and contains will not be able to use the index (yet). CREATE  INDEX  ON  :Person(firstname,  lastname);
 //  Direct  composite  index  search  on  multiple  property  equality   MATCH  (n:Person)  WHERE  n.firstname  =  'Joe'  AND  n.lastname  =  'Soap'  RETURN  n;   //  No  use  of  composite  index  (yet)   MATCH  (n:Person)  WHERE  n.firstname  =  'Joe'  AND  exists(n.lastname)  RETURN  n;   MATCH  (n:Person)  WHERE  n.firstname  =  'Joe'  AND  n.lastname  STARTS  WITH  'Soap'  RETURN  n;   MATCH  (n:Person)  WHERE  n.firstname  =  'Joe'  RETURN  n;  
  • 9. Reachability Queries - Pruning Var Expand MATCH  (kevin  {name:'Kevin  Bacon'})-­‐[*1..5]-­‐(actor)   RETURN  DISTINCT  actor
  • 10. Compiled Runtime • Coverage • 50% of Cypher Operators supported • Cypher Benchmarks Suite 15% supported • LDBC suite 18% supported • Does this mean many simple and few complex?
 • Performance • Operators 2x to 20x faster • Queries … well it depends… let’s say 2x for supported queries
  • 11. Compiled Runtime - Operators
  • 12. Compiled Runtime - Operators
  • 13. Compiled Runtime - LDBC Benchmarks
  • 15. Solving OR using Indexes • Consider AND
 MATCH (n:X) WHERE n.firstName = $first AND n.lastName = $last RETURN n • Solved with Index and Filter - FAST • But what happens with OR
 MATCH (n:X) WHERE n.firstName = $first OR n.lastName = $last RETURN n • 3.1: Solved with LabelScan and Filter - SLOW • 3.2: Solved with two IndexSeeks - FAST
  • 16. Solving OR using indexes
  • 17. Resources • Compiled Runtime Coverage Performance Improvements in Neo4j 3.2