Friday, March 24, 2023
HomeRuby On RailsEasy to Miss Means to Enhance ActiveRecord SQL Memory Use in Bed...

Easy to Miss Means to Enhance ActiveRecord SQL Memory Use in Bed Rails


Slow and bloated SQL queries are represented by elephants Photo by Pixabay from Pexels

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 <

RELATED ARTICLES

Most Popular

Recent Comments