Eager loading is nice with the include attribute
Post.find(:all, :include => :author)
I\'m wondering if you can also eager load counts, like
In MySQL at least, it is faster to do these as two separate calls because you get to avoid the join. I know this doesn't answer your question, but it seems like you're trying to get better speed and doing
Post.find ...
Then
post.comments.count
Is faster and more memory efficient (for the database) than if you retrieve both in one query.