N+1 Queries should be the exception, not the easy trap to fall in

One thing related which we are talking about including in Rails is including rack-mini-profiler by default.

Recently Osama Sayegh finished some internal cleanup that passed @rafaelfranca’s review and this was merged into Rails :confetti_ball:

https://github.com/rails/rails/pull/38701

I personally rely on it quite a lot to find N+1s both in dev and production cause it becomes quite a habit to sneak a look there and notice right away if something is looking odd.

10 Likes