|
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).
|