New to Rails 3? Check out the Ruby on Rails 3 Tutorial book and screencast.

A book and screencast series showing you how to develop and deploy industrial-strength Rails apps in a direct, step by step way. The screencast series includes 12 lessons over more than 15 hours! Get the best "over the shoulder" experience of following what a top Rails 3 developer does when building an app today. Click here to learn more.

Scrooge: An Automatic Database Query Optimizer

In Miscellaneous, Plugins

scrooge.png Scrooge (or Github repository) is a "dynamic query optimizer" (created by Lourens Naudé) that's framework and ORM agnostic but, naturally, will probably find its biggest market in Ruby land with Rails developers. To this end, Ilya Grigorik has put together an explanatory article, ActiveRecord Optimization with Scrooge.

In short, you can install Scrooge as a plugin, and from that point it'll unobtrusively monitor the database queries made by your app, along with which attributes are used from the data returned. Monitoring this over time allows Scrooge to establish which attributes are actually being used (or, more importantly, those that are definitely not) and it can then automatically change the queries in future to be as lean as possible. Currently Scrooge is well tested on Rails 2.3, though it is also known to work on 2.2.2. Ruby 1.9.1 support is pending.

You can learn a lot more about Scrooge's operation from the rather detailed documentation on the Github page.

Post to Twitter Tweet This Post

Vaguely Related Posts (Usually)

Leave a Reply