Skip to content

fix: optimize database queries to use find_each instead of all.each#1730

Open
ChaiWithJai wants to merge 1 commit intomasterfrom
fix/optimize-database-queries
Open

fix: optimize database queries to use find_each instead of all.each#1730
ChaiWithJai wants to merge 1 commit intomasterfrom
fix/optimize-database-queries

Conversation

@ChaiWithJai
Copy link
Copy Markdown
Collaborator

  • Replace ActiveStorage::Attachment.all.each with find_each in subdomain.rb
  • Replace ActiveStorage::Blob.all.each with find_each in subdomain.rb
  • Replace executed_api_actions.where(...).each with find_each in api_namespace.rb
  • Improves memory efficiency for large datasets by processing records in batches
  • Prevents memory exhaustion when dealing with large numbers of attachments/blobs

This addresses performance issues with large dataset processing.

- Replace ActiveStorage::Attachment.all.each with find_each in subdomain.rb
- Replace ActiveStorage::Blob.all.each with find_each in subdomain.rb
- Replace executed_api_actions.where(...).each with find_each in api_namespace.rb
- Improves memory efficiency for large datasets by processing records in batches
- Prevents memory exhaustion when dealing with large numbers of attachments/blobs

This addresses performance issues with large dataset processing.
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.

1 participant