0
votes

We have turned on auto indexing for both nodes and relationship. By default NEO4J will create an index named "node_auto_index" for nodes and "relationship_auto_index" for relationships. But the MATCH queries seem to be under performing (comparing to a similar data set in Elasticsearch). Looks like they are not using the indexes.

Is there a way to make the MATCH clause use the auto_index ?

We also tried looking at the schema index. Looks like it can only create node indexes. Our queries use some properties on relationships and hence even after using the schema index the queries are unacceptable in performance. Is there a way to create schema relationship indexes ?

1
Can you update your post and include the query?Luanne

1 Answers

0
votes

The node_auto_index is not used for match, you would have to use the start clause to access that legacy index.

e.g.

START user=node:node_auto_index(name="Siddarth")
MATCH (user)-[:KNOWS]->(friend)
RETURN friend

In Neo4j 2.0 you can create an index or unique constraint instead

create index on :User(name);

and then use it in MATCH

MATCH (user:User {name:"Siddarth"})-[:FRIEND]->(friend)
RETURN friend

See also the manual: http://docs.neo4j.org/chunked/milestone/query-schema-index.html and the cypher refcard: http://neo4j.org/resources/cypher