I am trying to make a search field, where i want the searchresults while typing. Therefore it needs to be VERY fast (at least somewhat as fast as typing, which is under .3 seconds pr. character)
MATCH (n)<-[:Mark]-(m) WHERE m.name CONTAINS "Villads" WITH n AS soegeresultat, m AS relevant RETURN relevant LIMIT 1
@villadsclaes2
Your queries use no labels. i.e. match (m) simply says find me a node. if your graph has 100 million nodes then match (n) is going to traverse each of the 100 million nodes. However if your nodes have labels and lets say your graph of 100 million total nodes has 50k :Person nodes and your query is such that the search text is in a node with label :Person then a match (n:Person) would only scan 50k nodes, rather than all nodes in the graph.
also from a performance analysis perspective if you preface any cypher query with `EXPLAIN` you will be able to see the path the query takes to satisfy the query.
how to delete this comment?
@villadsclaes2
do u have a specific query concern?
That was a quick reply. I dont know how to edit a post, so I wrote it in the comments:
https://community.neo4j.com/t5/neo4j-graph-platform/make-this-query-faster/td-p/64886