Using specific relationship type names in Neo4j graph data models (e.g., HAS_PHONE, HAS_EMAIL) instead of generic names (e.g., HAS) can significantly improve Cypher query performance. A concrete comparison shows that specific relationship types reduce database hits by ~28% on a small graph by eliminating the end-label filtering step and reducing the expand operation cost. The Neo4j storage engine separates relationships by direction and type, so specific names allow it to selectively load only relevant data. Additional benefits include lower costs on Neo4j Aura GDS sessions, better flexibility with dynamic relationship types (Neo4j 5.26+), and improved graph visualization customization.

5m read timeFrom medium.com
Post cover image
Table of contents
Learn why the names of relationships types in your graph data model are important for optimizing your cypher queries.IntroductionVersion 1: same names for the relationship typesVersion 2: different names for the relationship typesComparisonConclusion

Sort: