Reviewing plan operators
We will take a look at a few important operators that we will encounter most often while tuning queries.
These operators impact query performance the most and are listed as follows:
AllNodesScan
: This means the database is looking at all the nodes. Most often than not, this means the user forgot to provide a label. There are scenarios where this might be the intention. Most users when they are beginning with Cypher add the label name but forget to add":"
before the label. An example looks like this:MATCH (Drug {code: '1234'} RETURN *
We might have thought we provided the label name, but since we don’t have ":"
before the label, it will be treated as a variable, and we will see all nodes are being looked at.
CartesianProduct
: This is a scenario when we have multipleMATCH
statements without theWITH
clause between them. A sample of such a scenario looks like this:MATCH (p:Patient)
MATCH (d:Drug)
RETURN...