Home / Companies / Neo4j / Blog / Post Details
Content Deep Dive

Slow Cypher Statements and How to Fix Them

Blog post from Neo4j

Post Details
Company
Date Published
Author
Adam Cowley
Word Count
1,165
Company Posts That Month
12
Language
English
Hacker News Points
-
Post removed?
No
Summary

The issue with the slow Cypher statement lies in the large number of relationships being expanded, particularly with the Neo4j Fundamentals course having a high number of enrollments. The query plan identified that starting at the (:Course) node was the best place to begin the traversal, which is sensible given the schema. However, when 40k :FOR_COURSE and 40k :HAS_ENROLMENT relationships are expanded, the query time increases significantly due to the large amount of data being checked. To improve performance, using indexes can help reduce the number of database hits. By adding a USING INDEX clause to the query, the statement was able to register only 592 total db hits in 404 ms, resulting in a 1385% performance improvement.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
Developer Experience 1 400 163 88 +13%
LLM 1 2,401 292 122 -7%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.