4 ms·
This is a popular trope, but in practice it's just as easy to do n+1 via your own abstractions where "items.each { |i| i.foo }" happens to do it too. Without an
by viraptor 5y ago
This is a popular trope, but in practice it's just as easy to do n+1 via your own abstractions where "items.each { |i| i.foo }" happens to do it too. Without any ORM involved. Everyone will do it sometimes and the question is only whether you're going to spot it before it causes an outage. (In many cases it will only cause a slight slowdown)
At least there are tools to warn you about n+1 automatically https://github.com/flyerhzm/bullet https://github.com/flyerhzm/bullet