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

Optimize elements loading #31

Merged
merged 4 commits into from
Jan 21, 2021
Merged

Optimize elements loading #31

merged 4 commits into from
Jan 21, 2021

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Jan 19, 2021

This optimizes loading of elements by introducing decidated models that uses ruby methods to filter elements by attributes instead of using the database. This allows to preload all_elements at once and reduces DB queries a lot.

co-authored by @mamhoff

@tvdeyen tvdeyen force-pushed the optimize-elements-loading branch from 743ff01 to 58758b3 Compare January 19, 2021 19:12
@tvdeyen tvdeyen force-pushed the optimize-elements-loading branch from 58758b3 to 6a3f958 Compare January 21, 2021 08:31
@tvdeyen tvdeyen marked this pull request as ready for review January 21, 2021 08:31
@tvdeyen tvdeyen requested a review from mamhoff January 21, 2021 08:33
Copy link
Contributor

@mamhoff mamhoff left a comment

Choose a reason for hiding this comment

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

👍

We will use these decorators to load the elements in an efficient way
to avoid N+1 queries.
This helps to reduce DB queries while keeping the existing API
@tvdeyen tvdeyen force-pushed the optimize-elements-loading branch from 6a3f958 to 7aa6218 Compare January 21, 2021 09:38
@tvdeyen tvdeyen merged commit cc9607d into main Jan 21, 2021
@tvdeyen tvdeyen deleted the optimize-elements-loading branch January 21, 2021 14:03
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