So you want to create 1M relationships in total?

I wrote a blog post about that some time ago:

http://jexp.de/blog/2014/03/quickly-create-a-100k-neo4j-graph-data-model-with-cypher-only/
 
<http://jexp.de/blog/2014/03/quickly-create-a-100k-neo4j-graph-data-model-with-cypher-only/>

in your case I'd give Neo4j enough heap (4-8G) and run:

neo4j-sh (?)$ foreach (id IN range(1,100000) | CREATE (:User {uid:id, 
name:"user"+id}));
+-------------------+
| No data returned. |
+-------------------+
Nodes created: 100000
Properties set: 200000
Labels added: 100000
5097 ms

neo4j-sh (?)$ match (u:User)
 unwind range(1,10) as round
 with toInt(rand() * 100000) as id, u
 MATCH (u2) where id(u2) = id
 CREATE (u)-[:FRIEND]->(u2);
+-------------------+
| No data returned. |
+-------------------+
Relationships created: 1000000
9420 ms

match (u:User)
unwind range(1,10) as round
with toInt(rand() * 100000) as id, u
MATCH (u2) where id(u2) = id
CREATE (u)-[:FRIEND]->(u2);


> Am 18.01.2016 um 12:52 schrieb Francesco Pinto <[email protected]>:
> 
> Hi guys. I've created 100.000 users with just id and a name.
> I'd like to create for each of these user 10 random friendships with the 
> other users.
> I'm having trouble accomplishing this.
> 
> Thanks for any help you can give me.
> 
> F
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to