Identifying slow Rails queries with sqlcommenter
In a large Rails application, it can be tricky to track down where a slow query is coming from in the app.Solutions to this problem have been steadily improving. First, we had the Marginalia gem, which adds comments to all your queries. This allows you to see which controller or job a query came from by reading your logs.As of Rails 7, Marginalia has become a native feature to Rails. No more gem needed. While this is a great improvement, we can still take our Rails query comments one step further.
Identifying slow Rails queries with sqlcommenter #ruby #rails #rubyonrails #bosnia #programming #tutorials #rubydeveloper #railsdeveloper