Question

Are references bi-directional, in the sense that given ?cat, datomic does no searching to find the related entity, ?person, in a [?person :pet ?cat] restriction?

Or should I manually build a reference in the other side (e.g. setting an :owner attribute for pets) to prevent a linear search in all the ?persons that have :pets?

Was it helpful?

Solution

No, There is no speed advantage to storing both sides of a relation explicitly, all relations are bi-directional in datomic.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top