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

Solve n+1 queries problem by eager loading associated users with scores #2

Conversation

vlad-vitca
Copy link

@vlad-vitca vlad-vitca commented Nov 26, 2021

Fixes: #1

Changes

When feed API was requested, users associated with each score were lazy loaded. This generated a different query for each score to load it's user. Now scores eager load users on feed so users are taken at once from the database.

Before

image

After

image

@vlad-vitca vlad-vitca deleted the feature/improve-feed-scores-performance branch November 26, 2021 10:03
danielgolf referenced this pull request in danielgolf/golfr_backend Dec 7, 2022
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.

2 participants