make GetAllRelationships more efficient