RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Why N+1 Queries Are a Natural Result of Lazy Loading

N+1 is lazy loading repeated across a collection. This RailsRevelry article traces the per-owner association load path, the relation.loaded? versus association(:invoices).loaded? distinction, preload/eager_load/includes, why preloading doesn’t fix count or scoped reads, and strict_loading as enforcement.

https://railsrevelry.substack.com/p/n-plus-one-queries-lazy-loading?r=4jsb

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in