
By default, Bed rails ActiveRecord implements the majority of the SQL inquiries in a non-optimal method. In this post, I’ll define exactly how to repair this concern to accelerate traffic jams and also lower memory use.
Puffed up ActiveRecord inquiries
Energetic Document equips programmers to compose rather facility data source inquiries without recognizing the underlying SQL. Regrettably, the exact same ActiveRecord is a factor for most of the concerns that I run into while performing my Bed rails efficiency audits. Alongside the notorious N +1 phone calls, ” puffed up” inquiries are one more usual trouble.
Allow’s see it at work:
app/models/user. rb
course Individual <