But this returns the number of Nodes/Relationships in the entire DB. I'd be interested in having the number of Relationships attached to a particular node, without having to count them myself.
On Wednesday 30 December 2009 16:46:43 Laurent Laborde wrote: > I asked the questions twice, so i now know the answer : > http://github.com/tinkerpop/gremlin/blob/master/trunk/src/main/java/com/tin > kerpop/gremlin/db/neo/NeoGraph.java#L108 > > Undocumented API : > nodeManager.getNumberOfIdsInUse(Node.class) > nodeManager.getNumberOfIdsInUse(Relationship.class) > > > I would be interested in this as well. > > > > I was hoping for something like a "relationshipCount" property built in > > to the node core class. Until now I have been using a loop to count the > > results of the getAllRelationships method. > > > > On Wednesday 30 December 2009 16:08:00 Lorenzo Livi wrote: > >> Hi all, > >> I have two questions about performance. > >> > >> 1) I need to calculate the degree of a node (outlinks+inlinks). I can > >> see that neo4j use lucene to index the node, so each node is a lucene > >> document, and we can search the nodes by properties. So if I need to > >> get the degree I can't use the index because the relationships (edges) > >> are not indexed? It's correct? > >> The getRelationships() method (from Node class or batch inserter mode) > >> is optimized to do so? > >> Is there a better way to do this? > >> I'm thinking abount storing the adiacence of nodes as properties of > >> the nodes. Then I can lookup the adiacence using lucene. This may be > >> wrong? > >> > >> 2) Do you think that using multiple threads for creating the graph is > >> a good idea? I mean from performance point of view both using > >> transaction and batch mode. > >> > >> Thanks for any help. > >> strozzino > >> _______________________________________________ > >> Neo mailing list > >> [email protected] > >> https://lists.neo4j.org/mailman/listinfo/user > > > > _______________________________________________ > > Neo mailing list > > [email protected] > > https://lists.neo4j.org/mailman/listinfo/user > _______________________________________________ Neo mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

