Currently the two relationship join queries (VertexEdge and EdgeVertex) union 2 large select statements, for every resource collection, in order to capture if the origin of the relationship request is referenced in the relationship table on the FIRST or SECOND set of relationship columns. With the introduction of the relationshipreferences table, from
OPENIDM-13632, we can also store which side of the relationship table holds the reference to the origin resource. We would then only need to union only the sides that have existing references. This will further improve performance.