What I Learned Today

  • query_reviewer is amazing. This is the best tool I've had as a Rails developer in a long time. I used it today to find a page on one of our sites with 495 queries, and get it down to 40-odd. One page on a client's site went from a few hundred to 3 queries. Absolutely fantastic.
  • I used fragment caching for the first time, and it was dead simple.
  • You can round numbers in SQL. Simple enough, but I didn't know it: SELECT ROUND(AVG(ratings.rating), 2) FROM ratings.

I love finding performance tweaks in apps. I don't know why I hadn't focused on it in Rails before, but it's my new goal to make my Rails apps scream.

Published: 12 Mar 2009