|
|
|
|
|
by nathan_long
2655 days ago
|
|
> Perhaps you don't want everything eager loaded, but you want an exception to be raised if you try to access an associated record that hasn't been preloaded. Yes, exactly. > When I need to load/use them along with many parent records, it seems pretty obvious that I'll want to include those associations (eagerly loaded) in my AR query to avoid N+1 queries as you mentioned. Then again, maybe I've just spent too long taking those assumptions for granted where newer devs might not. You know that and I do too, but legacy Rails apps tend to be full of N+1 queries in my experience, and it's a major cause of slowdowns. |
|
https://semaphoreci.com/blog/2017/08/09/faster-rails-elimina...
https://github.com/flyerhzm/bullet
EDIT: It looks like this was already mentioned in another thread. I guess I don't understand the issue if that doesn't solve your problem.