NEO4J label support

Why is it recommended to avoid unnecessary labels in query patterns for better performance?

@kumar3320bb

because if you run for example

match (n:Person)-[:FOLLOWS]->(n2:Athlete)

then we 1st find a :Person node.. then check to see if there is a :FOLLOWS relationship and then check to see if this relationship points to a node with a label of :Athlete.

now if you run

match (n:Person)-[:FOLLOWS]->(n2)

we eliminate the check of if this relationship points to a node with a label of :Athlete

course this doesnt really work of :FOLLOWS links to nodes of label :Athlete and :Actor and :Politician for example since ->(n2) would look at any node connected to a :FOLLOWS relationship and so you might get results that include :Actor and :Politician