The following two queries differ in performance by about two orders of magnitude:
6 results, time: 0.000422085s
MATCH (n)<-[r:SECURITY]-() WHERE ID(n) = 108253 RETURN r
6 results, time: 0.031369832s
MATCH (n)<-[r:SECURITY]-(s) WHERE ID(n) = 108253 RETURN r, s
Is there any way to speed up the second query?
edit: Here are the relationship counts of the start nodes:
I found the reason: some of the start nodes contain a very large string property which takes several milliseconds to transfer. The performance is as expected when the property value is set to null.
This post can be deleted (I don't have permission to delete the topic and I was not able to find the suggested "flag for moderator attention" in the user interface, so please delete this topic for me.)
I'm thinking that issues like this would make more sense on the github issue tracker where we can close issues when they are either fixed (or as in this case the original problem is discovered to be different). I think the community site is more for question/answer discussions? I agree that the difference can be quite subtle though.
But I found a way to close it anyway, so all is good!