Re: Adding a bunch of Vertices and edges takes for ever


I should add I do this query (to eliminate duplicate vertices) before adding each Vertex as I know that in the existing RDBMS same nodes exist multiple times:

javaGraph.traversal().V().hasLabel(instanceId).has("nodeId", nodeInfo.getId());

        if (vertexNode.hasNext()) {
        } else {
            JanusGraphVertex node = javaGraph.addVertex(instanceId/*,,((Integer)id).longValue()*/);
  "nodeId", id);
            return node;

Do I need to index the label as well?

Any other ideas?

On Monday, September 11, 2017 at 11:03:07 AM UTC+3, ya...@... wrote:
I am writing an app that loads an existing RDBMS based graph implementation into JanusGraph.

I create this index:

        JanusGraphManagement mgmt = javaGraph.openManagement();
        if (mgmt.containsPropertyKey("nodeId")) {
            nodeId = mgmt.getPropertyKey("nodeId");
        } else {
            nodeId = mgmt.makePropertyKey("nodeId").dataType(Integer.class).make();

            JanusGraphManagement.IndexBuilder nodeIdIndexBuilder = mgmt.buildIndex("nodeIdInd", Vertex.class).addKey(nodeId);
            JanusGraphIndex nodeIdIdx = nodeIdIndexBuilder.buildCompositeIndex();


Creating the vertices and edges (~6K vertices and ~40K edges) takes a very long time.

Am I missing something?

Join to automatically receive all group messages.