Each related Instance in a relationship is fetched by its uid in RelationshipRepository::getRelationships(Instance). This can lead to a massive amount of queries against the database.
The class Relationship should be refactored so that it does not contain two Instance members. It should rather contain to InstanceShim members that contain only the name and the uid of the Instances they represent.
Each related Instance in a relationship is fetched by its uid in
RelationshipRepository::getRelationships(Instance)
. This can lead to a massive amount of queries against the database.The class
Relationship
should be refactored so that it does not contain twoInstance
members. It should rather contain toInstanceShim
members that contain only the name and the uid of the Instances they represent.