<p dir="auto">I downloaded neo4j-master from github, today.<br>
Within neo4j-master there is a directory : neo4j-master/community/io/src/main/java/org/neo4j/io</p>
<p dir="auto">I also obtained the community edition 2.16, which should contain all the jars for neo4j projects.<br>
However, there is no neo4j.io.jar corresponding to the neo4j-master code above.</p>
<p dir="auto">I tried to compile neo4j-master/community/embedded-examples/src/main/java/org/neo4j/examples/NewMatrix.java<br>
The last import  :: "import org.neo4j.io.fs.FileUtils;" was missing.</p>
<p dir="auto">I obtained  neo4j-io-2.2.0-M02.jar from <a href="http://mvnrepository.com/artifact/org.neo4j/neo4j-io/2.2.0-M02" rel="nofollow">http://mvnrepository.com/artifact/org.neo4j/neo4j-io/2.2.0-M02</a><br>
and added it to my project.  The project then compiled and ran fine...<br>
Further, the online javadoc for neo4j 2.16 does not cover package org.neo4j.io<br>
(<a href="http://neo4j.com/docs/2.1.6/javadocs/" rel="nofollow">http://neo4j.com/docs/2.1.6/javadocs/</a>)</p>
<p dir="auto">It would be nice if there was a community version of neo4j which would compile the examples, out of the box.</p>
<p dir="auto">I have a total of 200,001 nodes out of which one node joins with 200,000 other nodes. so 200,000 relationships total.</p>
<p dir="auto">All these nodes are coming from Kafka so my Kafka Consumer reads a set of nodes(a batch) from Kafka and applies the following operation.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="MATCH (a:Dense1) where a.id &lt;&gt; &quot;1&quot; 
WITH a 
MATCH (b:Dense1) where b.id = &quot;1&quot; 
WITH a,b 
WHERE a.key = b.key 
MERGE (a)-[:PARENT_OF]-&gt;(b)"><pre class="notranslate"><code class="notranslate">MATCH (a:Dense1) where a.id &lt;&gt; "1" 
WITH a 
MATCH (b:Dense1) where b.id = "1" 
WITH a,b 
WHERE a.key = b.key 
MERGE (a)-[:PARENT_OF]-&gt;(b)
</code></pre></div>
<p dir="auto">And this takes forever to build 200,001 relationships both with index or without index on id and key. If I change <code class="notranslate">Merge</code> to <code class="notranslate">CREATE</code> then it is super quick(the fastest)! however, since I have to read a batch from kafka and apply the same operation incrementally the relationships are getting duplicated if I use <code class="notranslate">CREATE</code> for every batch.</p>
<p dir="auto">Ideally, if a relationship exists I don't want Neo4j to do anything or even better throw an exception or something to the client driver that way application can do something useful with it. I also tried changing <code class="notranslate">MERGE</code> to <code class="notranslate">CREATE UNIQUE</code> in the above code it is 50% faster than <code class="notranslate">MERGE</code> but still slow compared to <code class="notranslate">CREATE</code>.</p>
<p dir="auto">If <code class="notranslate">MERGE</code> is this slow due to double locking as explained <a href="https://stackoverflow.com/questions/56884135/creating-200k-relationships-to-a-node-is-taking-a-lot-of-time-in-neo4j-3-5/56910110" rel="nofollow">here</a> Then it almost becomes unusable.</p>
<p dir="auto">Any approach to make it better would be great!</p>