0

In the following cypher:

START n = node(0, 1, 2, 3 .... n)

What is the maximum number of Node IDs (n) which can be referenced?

Stewart
  • 17,616
  • 8
  • 52
  • 80
  • Possibly it has to do with the max size of an array of longs, so maybe these 2 posts are relevant? http://stackoverflow.com/questions/3038392/do-java-arrays-have-a-maximum-size http://stackoverflow.com/questions/31382531/why-i-cant-create-an-array-with-large-size – Stewart Apr 05 '16 at 15:10
  • What version of Neo4j are you using? The Cypher `START` clause has been deprecated. For recent versions of Neo4j the equivalent would be: `MATCH (n:Person) WHERE id(n)IN [0,1,2,3,4]` – William Lyon Apr 05 '16 at 17:58
  • Version is 2.2, but recently upgraded from 1.9. These nodes have no label. – Stewart Apr 05 '16 at 21:42
  • How do you select Nodes by ID without using a `START` clause? Only with a label? – Stewart Apr 05 '16 at 21:43
  • Label is optional: `MATCH (n) WHERE id(n) IN [0,1,2,3,4] RETURN n` – William Lyon Apr 05 '16 at 21:45
  • How does that work internally? Do it not search all nodes before the `WHERE` clause is applied? Seems intuitive to me that the `START` version would be more performant because of the limited set. – Stewart Apr 05 '16 at 22:14
  • 1
    Using [PROFILE](http://neo4j.com/docs/stable/how-do-i-profile-a-query.html), I see that the query without `START` does indeed scan all nodes, using the default `COST` planner. However, if you [tell Cypher to use the `RULE` planner](http://neo4j.com/blog/tuning-cypher-queries/), the query plan seems to be as efficient as the query with `START`. – cybersam Apr 06 '16 at 18:10

0 Answers0