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

fix: Optimize feeds query #86

Merged
merged 1 commit into from
Aug 23, 2023
Merged

fix: Optimize feeds query #86

merged 1 commit into from
Aug 23, 2023

Conversation

aronza
Copy link
Contributor

@aronza aronza commented Aug 22, 2023

Summary:

Currently the API runs a database query for every external foreign key it needs to fetch. This causes the /v1/feeds endpoint to return 1903 feed objects in 12.99 seconds (according to PostMan)

Screenshot 2023-08-21 at 9 40 18 PM

Expected behavior:
With these changes the endpoint returns under 600 milliseconds for the same amount of feed objects.

Screenshot 2023-08-21 at 9 42 13 PM

@aronza aronza changed the title Optimize feeds query fix: Optimize feeds query Aug 22, 2023
@aronza aronza self-assigned this Aug 22, 2023
Copy link
Contributor

@cka-y cka-y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Question: was the issue related to the redirects?

@aronza
Copy link
Contributor Author

aronza commented Aug 22, 2023

LGTM! Question: was the issue related to the redirects?

It was both redirects and external_ids.

@jujiang526
Copy link
Contributor

how is the performance after this change?

@indraneel indraneel linked an issue Aug 23, 2023 that may be closed by this pull request
@aronza aronza merged commit a785567 into main Aug 23, 2023
1 check passed
@aronza aronza deleted the arda/optimize-query branch August 23, 2023 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DB Query optimizations
3 participants