Closed AlexiosP closed 3 years ago
Thanks a ton for the input, we are gonna discuss this in the upcoming week. 👍
@michael-simons is there some quick and dirty solution we can apply now? We invested a lot of time to update to SDN 6.x and this problem really degrades our production performance. We can of course try to revert update, but we would like to avoid it. I would appreciate any hints
You can always run it as custom query via @Query
.
Thanks for taking the time and reporting the comparison. I adapted your suggestion with a few modifications to our query generating mechanism and merged it into the 6.1.x and main branch.
When calling the
findAllById
method of a repository, the last cypher query which retrieves all the nodes and their related entities is the belowThis obviously can use a lot extra memory and results to a long execution time due to the fact that it first matches the root nodes, afterwards for each of related nodes it matches relationships, etc.
Compared to something like the below
or due to the behavior of DISTINCT in neo4j, it could be written as below
there's a significant improvement as can be seen below
SDN version that has been tested with: 6.1.4, 6.1.5, 6.2.0-M3 neo4j version: 4.2.3 enterprise