Predicate performance question

Is there a performance difference between using a predicate in one direction or in the reversed one ?
Example:

A rel B
vs
B ~rel A

More generally, when we design a schema we have to choose in which direction we set a relation (A rel B) or (B rel A).
Is there a best practice for choosing one rather another ?

By default Dgraph is a DB that follows a single direction o->o . Reverse edges are only used in specific cases. Using reverse edges as a major part of your Schema’s modeling logic is not recommended. You must use Reverse in specific cases.

About performance, they are similar. There are no benchmarks in this regard. But fundamentally they are similar. Reverse edges are a type of indexing.

1 Like