Hi,

On Wed, Dec 30, 2009 at 4:08 PM, Lorenzo Livi <[email protected]> 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?

Correct.

> The getRelationships() method (from Node class or batch inserter mode)
> is optimized to do so?

The getRelationships methods are optimized to return relationships
(for traversal), not to count the number of relationships on a node.

> 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?

Storing the relationship count as a property on the node is a good
solution to the problem. I do not know why you would have to index the
property using lucene unless you plan to query for for "give me all
nodes with relationship count X".

>
> 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.

>From a performance point of view the bottleneck for writes is the
disk. If you update different parts of the graph in different threads
and have good hardware (raid) you may get a higher insert/update
speed. Batch inserter mode does not support concurrent updates.

Regards,
-Johan
_______________________________________________
Neo mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to