2010/2/2 Maria Giatsoglou <[email protected]>: > Hello all > > I am creating a project that performs a number of benchmark tasks on Neo. > One of the tests measures the required time for creating a relationship > between two neo nodes A and B. > However, before creating the relationship, it should firs be checked > whether a relationship of the same type already exists > between these two nodes. My current implementation calls the > getRelationships() function > for the A node and then iterates over the returned Iterable object > checking whether a relationship's end node is equal to node B. If such > a relationship does not exist, then the required relationship is created > between nodes A and B. Yep that's a very common scenario, however exposing that as a method in the API could potentially hide performance pitfalls if a node has several millions of relationships on it, or similar. > > However, this technique seems to be very slow, with the creation of a > relationship (including the check operation) taking around 57msec to > complete. Is there a faster way to implement this operation? I > considered trying to modify the LuceneIndexService implementation in > order to enable indexing > relationships apart from nodes. Do you recommend such an approach for > this problem? That's normally a very fast operation. Does your nodes have a very large amount of relationships on them? And also, are you including the time it takes to commit the transaction in those 57ms? Would it be ok if you could post a piece of your code which handles this? > > Many thanks in advance, > > Best regards, > > Maria Giatsoglou > _______________________________________________ > Neo mailing list > [email protected] > https://lists.neo4j.org/mailman/listinfo/user >
-- Mattias Persson, [[email protected]] Neo Technology, www.neotechnology.com _______________________________________________ Neo mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

