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

HOTFIX: add eager loading #1

Conversation

vlad-luca-golfgenius
Copy link
Owner

Fixes: issue url

Changes

Every time the feed of an user was fetched there where n + 1 queries:

  • 1 query to fetch all the scores
  • n queries to fetch for each scores the user

By adding .includes(:user) the users will be loaded into memory all at the same time and such we will only have 2 queries:

  • 1 for fetching the scores
  • 1 for fetching the users

Before

Screenshot 2022-07-11 at 10 49 57

After

Screenshot 2022-07-11 at 10 51 31

@vlad-luca-golfgenius vlad-luca-golfgenius deleted the hotfix/hotfix-improve-score-feed-performance branch July 12, 2022 12:08
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.

Improve scores feed performance
1 participant