Izo Toda
Izo Toda

Reputation: 15

Neo4j Embedded Java API Perfomance

The question is regarding the

findNode(label, propertyName, propertyValue)

function. Once I have the node, what operations are cheap and what operations are expensive ? For example, does the node object get retrieved together with all its properties or does each

node.getProperty

call incur additional performance cost ? Cheers !

Upvotes: 1

Views: 46

Answers (1)

Michal Bachman
Michal Bachman

Reputation: 2661

findNode(label, propertyName, propertyValue) uses an index to retrieve the matching nodes. The properties won't be loaded with the resulting nodes.

node.getProperty will cause the entire property chain to be loaded (i.e. all the node's properties). So the first call to this method on any node/relationship is relatively "expensive", the subsequent ones will be cheap.

Upvotes: 1

Related Questions