URGENT - Commit VERY slow when creating many vertices and edges

hey all,

our datamodel is a tree which consists of x layers and any number of nodes such as:

     / \
    o   o
   / \   \
  o  o    o
    / \ \
    x  x ...  

Sometimes we need to update / restructure the whole tree. This operation is quite heavy if we have like 40000 nodes. Performing just the queries takes up to 2 minutes (which is still acceptable for 40000 nodes ? - I don’t know) but what is even more strange is that the commit itself takes 50(!!!) minutes to finish. This is just unacceptable for productive usage. Why is that so slow? What can we do to improve the performance?

And what is even worse is that during that time no read operation is possible, the database seems just blocked at all.

Let me know if you need more infos.


Hi @jonsalvas

which kind of query do you do?

How big is the transaction?


I am doing a bunch of CREATE VERTEX and CREATE EDGE queries. The transaction itself is quite big. At least 20000 * 3 (create 2 vertices+ 1 edge) objects that are created on connected to each other.


Hi @jonsalvas

in a single batch?

Yeah in a db.begin() and db.commit() in a javascript function or what do you mean by “single batch”?

Oh ok in a server side javascript function?

Do you have an example?

yes we are using a javascript function. I attached a log containing all queries executed before commit. https://drive.google.com/open?id=1_j_H4K2sVn_ar0IXAs_sBxLsgXZFnlCb