Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad performance when doing API call on /objects #538

Closed
stevenbal opened this issue Mar 3, 2025 · 1 comment · Fixed by #540
Closed

Bad performance when doing API call on /objects #538

stevenbal opened this issue Mar 3, 2025 · 1 comment · Fixed by #540
Assignees
Labels

Comments

@stevenbal
Copy link
Collaborator

stevenbal commented Mar 3, 2025

Product versie / Product version

2.5.0 / latest

Omschrijf het probleem / Describe the bug

Gemeente Utrecht (taiga issue 335)

CommUtr voert een query uit op de objects-api: geef alle objecten van type Contactmoment waarbij het veld "zaaknummer"={waarde} en sorteer op veld {datum}

Deze relatief eenvoudige API call is erg langzaam. Het duurt eigenlijk altijd minstens 6 seconden maar we zien ook regelmatig 25 seconden

data_attrs = "zaaknummer__exact__{someId}"
ObjectTypeId is provided (contactmoment UUID)
Page number is 1
Page size = 1000
ordering = -record__data__contactmoment__datumContact

Stappen om te reproduceren / Steps to reproduce

No response

Verwacht gedrag / Expected behavior

No response

@stevenbal stevenbal added bug Something isn't working triage labels Mar 3, 2025
@stevenbal stevenbal self-assigned this Mar 3, 2025
@stevenbal stevenbal removed the triage label Mar 3, 2025
@stevenbal stevenbal moved this from Triage to In Progress in Data en API fundament Mar 3, 2025
stevenbal added a commit that referenced this issue Mar 3, 2025
the filter to only include the objectrecords with the highest index per object was causing major performance degradations, especially in combination with filters on data_attrs.
Instead of using `Max(...)` we now use Window to figure out the max index per object
stevenbal added a commit that referenced this issue Mar 3, 2025
the filter to only include the objectrecords with the highest index per object was causing major performance degradations, especially in combination with filters on data_attrs.
Instead of using `Max(...)` together with GROUP BY, we now use Window to figure out the max index per object which is more efficient for larger datasets
stevenbal added a commit that referenced this issue Mar 4, 2025
the filter to only include the objectrecords with the highest index per object was causing major performance degradations, especially in combination with filters on data_attrs.
Instead of using `Max(...)` together with GROUP BY, we now use Window to figure out the max index per object which is more efficient for larger datasets
stevenbal added a commit that referenced this issue Mar 4, 2025
the filter to only include the objectrecords with the highest index per object was causing major performance degradations, especially in combination with filters on data_attrs.
Instead of using `Max(...)` together with GROUP BY, we now use Window to figure out the max index per object which is more efficient for larger datasets
stevenbal added a commit that referenced this issue Mar 4, 2025
the filter to only include the objectrecords with the highest index per object was causing major performance degradations, especially in combination with filters on data_attrs.
    Instead of using `Max(...)` together with GROUP BY, we now use Window to figure out the max index per object which is more efficient for larger datasets
stevenbal added a commit that referenced this issue Mar 4, 2025
the filter to only include the objectrecords with the highest index per object was causing major performance degradations, especially in combination with filters on data_attrs.
    Instead of using `Max(...)` together with GROUP BY, we now use Window to figure out the max index per object which is more efficient for larger datasets
@stevenbal stevenbal moved this from In Progress to Implemented in Data en API fundament Mar 4, 2025
@stevenbal
Copy link
Collaborator Author

Found a fix for the issue, might do a second bugfix release at the end of this week for it

stevenbal added a commit that referenced this issue Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant