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

Find node by id function faster

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

or property index?

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

I saw the profiling of these queries

  • Id function: 2 db totals
  • index: 1 total views db
+5
source share
1 answer

Finding by id is always faster, since it directly points to node -record.

+6
source

Source: https://habr.com/ru/post/1241207/


All Articles