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

Use locate_many to avoid N+1 #78

Closed
julianrubisch opened this issue Jan 31, 2021 · 1 comment · Fixed by #80
Closed

Use locate_many to avoid N+1 #78

julianrubisch opened this issue Jan 31, 2021 · 1 comment · Fixed by #80
Assignees
Milestone

Comments

@julianrubisch
Copy link
Contributor

https://github.com/rails/globalid#locating-many-global-ids

@julianrubisch
Copy link
Contributor Author

One way this could work would be to plug an each_with_object or reduce in

https://github.com/julianrubisch/futurism/blob/96add2e48b88f308eb75b73721a5f85e7d624543/lib/futurism/channel.rb#L21,

assemble anything that has an sgid with locate_many_signed, pluck it out, and resolve the rest.

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 a pull request may close this issue.

1 participant