Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-03-2023 11:59 AM - edited 02-03-2023 12:07 PM
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
Solved! Go to Solution.
02-03-2023 12:09 PM
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.
02-03-2023 12:01 PM
02-03-2023 12:05 PM
That was a quick reply. I dont know how to edit a post, so I wrote it in the comments:
02-03-2023 12:04 PM - edited 02-03-2023 12:08 PM
how to delete this comment?
02-03-2023 12:09 PM
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.
All the sessions of the conference are now available online