Neo4j - complexity of search by indexed parameter

时间:2016-07-11 20:18:01

标签: neo4j

I'm wondering what is the complexity of the following cypher query:

MATCH (i:Instance{id:{InstanceID}})
RETURN i
LIMIT 1

The "id" has unique constraint:

CREATE CONSTRAINT ON (i:Instance) ASSERT i.id IS UNIQUE;

How the search time is affected with a growing number of Instance nodes?

1 个答案:

答案 0 :(得分:4)

Due to the unique index this node lookup will be backed by an index (internally Lucene is used here). So it should be O(log(n)).