Speed up initial node location without using labels

To all the Graph enthusiasts,

Is there a way to speed up initial node location without using labels?
Hoping answer to my question.
Thanks in advance

Are you referring to the speed of looking up a node?

If you know the node's graph id, then you can look it up without knowing it's label:

MATCH (n)
WHERE id(n) = 12345
...

In the query plan you should see a NodeByIdSeek.

However these kinds of lookups tend to be rare, since you will rarely know the id of a node to lookup. And since ids of nodes and relationships can be reused (after deletion of the node or relationship), if you keep the ids outside of the database for later lookup, but don't keep it in sync with those deletions, then it could mean that a node lookup will instead get you a completely different node (since the one you wanted was previously deleted) or no node at all.

Otherwise, you'll need an index lookup, and all index lookups require that the node is labeled, and that the label of the index is present in the pattern used to find the node.

1 Like

Thanks for the help.