cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

What makes an anchor node and anchor node?

chribonn
Node Link

Hi,

I picked up an image at random https://neo4j.com/graphacademy/training-cqt-40/_images/HierarchyOfAccessibility.png.

If we assume that indexing is not involved why can't the middle node or the one marked Downstream node be anchor nodes if the Cypher Query Tuning mechanism determines that that is the most efficient approach?

If I revert to the analogy of the movies and actors, what stops either node from being an anchor node?

Thanks

1 REPLY 1

The traversal for a query must start at one end of the pattern. How the query processor selects what end to start at will depend upon what it can surmise about the number of nodes it needs to retrieve to anchor the query. If indexes are present it can determine which end to anchor on because it knows how many nodes are included in the anchor part of the query. That is why labels are useful because they provide an index to begin the traversal if no other indexes are present.

If you know that something in the middle of the pattern is a better anchor, then you need to reformulate your query pattern to take advantage of it.

Elaine