views:

21

answers:

1

I'm running a lot of ActiveRecord queries in my Rails app that have quite a few named and dynamic scopes. I was wondering if there is any difference performance-wise in how those scopes are order.

For example, could Person.american.adult.find(:all) be an slower than Person.adult.american.find(:all) ?

+1  A: 

Nope. Have a look at your log, and you'll see that ActiveRecord is working its magic by combining them all and then (if possible) performing a single query.

mylescarrick
many thanks. another reason to love rails :)