neo4jdatabase-performance

Neo4j: fastest way to find a node: by id function or index?


Is it faster find a node by id function

MATCH (i:Item) WHERE id(i) = 2345 RETURN i

or by a property indexed?

MATCH (i:Item { name: "Foo"}) RETURN i

Profiling these queries I saw


Solution

  • Find by id is always faster, as it directly points to the node-record.