Re: Transactions and uploading a lot of vertices
Alexander Scherbatiy <stell...@...>
I have a graph that I need to upload which has about 1000 vertices and 3000 edges.toggle quoted messageShow quoted text
I tried to load it using commit after
a) each iteration
b) every 100th iteration
c) after all data uploading
It took about a) 2.3s b) 2.3s c) 9.8 sec on my system.
I used 'graph.tx().commit()' code to commit uploaded data in transaction.
My graph parameters are:
JanusGraph graph = JanusGraphFactory.build()
The profiler shows that the most time in c) which uses only one commit after whole data uploading takes the method JanusGraphStep.executeGraphCentryQuery where it creates Sets.newHashSet() and then takes a lot time over iterating elements.
By the way, what is the right way to call transactions in JanusGraph?
The Transactions chapter in JanusGraph doc describes only examples of 'graph.tx().commit()' and 'graph.tx().createThreadedTx()'.
There is also method 'graph.newTransaction()'.
Is there drawbacks to explicitly create transactions by 'graph.newTransaction()' over using the default one and committing by 'graph.tx().commit()'?
On 26.09.2019 20:16, Pavel Ershov wrote:
It depends on graph structure how many properties/edges