# Bug OP-14135 - WorkPackage query with baseline filter takes too much time for non-admins

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

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Module |  |
| Target versions | 13.3.0 |
| Observed in versions | 13.2.0 |
| Sprint | 13.3.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 13.2.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

### Steps to reproduce

1.  Login to community as a user without admin permissions
2.  Execute this [query](https://community.openproject.org/api/v3/projects/14/work_packages?filters=%5B%7B%22status%22%3A%7B%22operator%22%3A%22%21%22%2C%22values%22%3A%5B%228%22%2C%225%22%2C%223%22%2C%226%22%2C%221%22%2C%222%22%5D%7D%7D%2C%7B%22subprojectId%22%3A%7B%22operator%22%3A%22%21%22%2C%22values%22%3A%5B%22606%22%5D%7D%7D%2C%7B%22type%22%3A%7B%22operator%22%3A%22%3D%22%2C%22values%22%3A%5B%221%22%5D%7D%7D%2C%7B%22version%22%3A%7B%22operator%22%3A%22%21%22%2C%22values%22%3A%5B%22830%22%5D%7D%7D%5D&includeSubprojects=true&offset=1&pageSize=0&timestamps=2024-01-15T00:00:00Z)

### What is the buggy behavior?

*   It takes forever to return with a result and eventually leads to a timeout

### What is the expected behavior?

1.  It should take the same time, as it would take to execute the query as an admin or anonymous user

### Environment information

**OpenProject installation type**

*   [x] Hosted cloud edition
*   [ ] Packaged installation
    *   What distribution?
*   [ ] Docker All-in-one container
*   [ ] Docker-compose installation
*   [ ] Other (please specify)

**OpenProject version**

_v13.2.1 (community)_

**Browser**

*   [ ] Chrome
*   [ ] Firefox
*   [ ] Safari
*   [ ] Mobile Safari
*   [x] Other (Brave)

**Language**

_en-US_
