RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: performance xActive Record x
Eager Loading (revised)
Episode #22 – Mar 20, 2013 – 223 comments

Eager Loading (revised)

One way to improve performance is to reduce the number of database queries through eager loading. Here I demonstrate this and compare the difference between the "includes" and "joins" methods. (7 minutes)
Full-Text Search in PostgreSQL
Episode #343 – Apr 17, 2012 – 131 comments

Full-Text Search in PostgreSQL

Postgres offers full-text searching right out of the box. This episode shows how to write queries from scratch, apply tools like Texticle and pg_search, and optimize performance through indexes. (16 minutes)
Active Record Queries in Rails 3
Episode #202 – Feb 22, 2010 – 71 comments

Active Record Queries in Rails 3

Rails 3 introduces a new query interface for performing finds in Active Record. See how it works along with the changes in named scopes. (10 minutes)
Performing Calculations on Models
Episode #14 – Apr 04, 2007 – 35 comments

Performing Calculations on Models

Did you know ActiveRecord provides class methods for performing calculations on models? You can even use these methods through associations. (2 minutes)
named_scope
Episode #108 – May 19, 2008 – 69 comments

named_scope

The named_scope method in Rails 2.1 makes performing finds on models very elegant and convenient. See how in this episode. (11 minutes)
Counter Cache Column
Episode #23 – Apr 25, 2007 – 69 comments

Counter Cache Column

If you need to display the record count for a has_many association, you can improve performance by caching that number in a column. (7 minutes)
Eager Loading
Episode #22 – Apr 23, 2007 – 54 comments

Eager Loading

One way to improve performance is to cut down on the number of SQL queries. You can do this through eager loading. Learn all about it in this episode! (4 minutes)