# Bug FPCV-52 - Updating the formula takes long after "Save" on larger instances

Project: Feature Project - Calculated value
Status: closed
URL: https://community.openproject.org/work_packages/FPCV-52

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date | 2025-07-10 – 2025-09-18 |
| Priority | Medium |
| Module | Modules and project features / Project attributes |
| Target versions | 16.6.1 |
| Observed in versions | 16.6.0 |
| Bug found in version (deprecated) | 16.6.x |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

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

## Planning

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

## Costs

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

## Description

### Steps to reproduce

1.  Have a larger number of projects (e.g. 2000)
    
2.  Be an administrator
    
3.  Have a calculated values that is only active in a single project (or non at all)
    
4.  (Re)Define a formula
    
5.  Press &quot;Save&quot;
    

### What is the buggy behavior?

*   Saving takes long
    
    *   That is because the code iterates through every project individually regarless of whether the project has the field or not and uses n+1 queries for loading the data.
        
    *   The action is carried out synchronously
        
*   ?Other modifying actions might take long as well?
    

### What is the expected behavior?

1.  Saving is quick
