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?

Était-ce utile?

La solution

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top