We're updating the issue view to help you get more done. 

Use Neo4J navigation over lookups when possible

Description

Let's assume entity A and B and a many to many relationship between A and B.

When loading A, we load the association information by navigating the relationship in Neo4J. From there we could navigate to the node representing the entity B. But in the current code, we do a lookup from the EntityKey to load all entities leading to a hit on the Neo4J index. Which AFAIK is suboptimal.

We could imagine that when we load the Tuple related to the RowKey (Neo4JAssociationSnapshot.get()), we could store the link to the target node (node representing B).
When the grid dialect plans to load B, we could check this caching structure and load B from the node link instead of a lookup.

Such a cache structure should probably be cached by transaction and per session (and possibly using some weak reference).

Environment

None

Status

Assignee

Unassigned

Reporter

Emmanuel Bernard

Labels

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Priority

Major