I have a long Cypher request (new version of Neo4J 2.0) that creates several nodes and connections using the MERGE command.
Question: do you think that I should divide it into different parts and transfer it as a transaction (for reliability), or should I keep a long single (for speed)?
Here's the request:
MATCH (u:User {name: "User"}) MERGE (tag1:Hashtag {name:"tag1"}) MERGE (tag2:Hashtag
{name:"tag2"}) MERGE (tag3:Hashtag {name:"tag3"}) MERGE (tag4:Hashtag {name:"tag4"})
MERGE tag1-[:BY]->u MERGE tag2-[:BY]->u MERGE tag3-[:BY]->u MERGE tag4-[:BY]->u;
(I purposefully made the request shorter, imagine that there are, for example, 50 tags (nodes) and even more edges)
source
share