Tag Archives: eager loading

Be careful how you count in Rails

I’ve just encountered this problem yet again effecting code I’m working though, so I thought I’d quickly blog about it.
Put basically if you call count on a relationship it will always make a db call to see how many there are even if the relationship has been populated.  If you use size or any? they [...]

Posted in Features, Miscellaneous | Also tagged , | 3 Comments
  •  

  • About Nahum Wild

    I'm a High Performance Website Consultant specialising in Ruby on Rails deployments. In this blog I cover common problems I've seen and provide insight on optimisation techniques.

  • Recommend Me

    Follow me on Twitter