# Bug OP-7869 - Transitive Relations embedded in work package representer -> poor performance

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-7869

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Module |  |
| Target versions | 11.0.3 |
| Observed in versions | 10.5.0 |
| Sprint | 11.0.3 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 10.5.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### **Environment**:

Your OpenProject Version: 11.0

### **Steps to reproduce:**

1.  Have three work packages: WP1, WP2, WP3
2.  Add relations, all of type &quot;relates&quot; from WP1 to WP2 and from WP2 to WP3 (assure this direction)
3.  Fetch WP1 from the API

### **Actual Behavior**

The response has three relations embedded at `_embedded/relations/_embedded/results` and the collection has a count of 3. The transitive relation from WP1 to WP3 as well as the reflexive relation from WP1 to itself are included.

That behaviour is not visible in the UI but on larger installations, which might have 100k or more transitive relations for a work package, this will decrease the performance drastically. 

### **Expected Behavior**

Only the direct relation from WP1 to WP2 should be embedded and the collection should have a count of 1.
