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

[Backport] Replace .all.each with .find_each to reduce memory usage #2887

Merged
merged 4 commits into from
Sep 17, 2018

Conversation

aitbw
Copy link
Collaborator

@aitbw aitbw commented Sep 10, 2018

References

Objectives

  • As per this section in the Ruby on Rails documentation, the usage of .all.each over an ActiveRecord model might exceed the amount of memory available if said model is associated with a table with a considerable amount of records. Thus, it has been replaced where possible with .find_each, which has considerable performance gains

Visual Changes

  • None

Notes

  • None

@voodoorai2000
Copy link
Member

Yes, great! 👌

@voodoorai2000 voodoorai2000 merged commit cae210c into consuldemocracy:master Sep 17, 2018
@aitbw aitbw deleted the backport/db_queries branch September 17, 2018 17:10
@voodoorai2000 voodoorai2000 added this to Release 0.17 in Roadmap Sep 17, 2018
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.

None yet

2 participants