Sign in through GitHub

RailsCasts Pro episodes are now free!

Learn more or hide this

Eager Loading (revised)

#22 Eager Loading (revised)

Mar 20, 2013 | 7 minutes | Performance, Active Record
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.
  • Download:
  • source codeProject Files in Zip (64.7 KB)
  • mp4Full Size H.264 Video (16.6 MB)
  • m4vSmaller H.264 Video (9.25 MB)
  • webmFull Size VP8 Video (7.53 MB)
  • ogvFull Size Theora Video (26 MB)