Marnen Laibow-Koser wrote in post #965796:
> Cameron Caine wrote in post #965790:
>> Marnen Laibow-Koser wrote in post #965782:
>>> Please avoid top-posting.
>>>
>>> Cameron Caine wrote in post #965778:
>>>> Thanks this certainly helps.  Any reason in particular why you don't
>>>> recommend getting aggregates in the same query?
>>>
>>> I thought about that again after I posted it.  It's less easy to use
>>> ActiveRecord's abstraction layer, and you may be getting a lot of data
>>> you don't need if you pack everything into the one query.  But it's
>>> probably not as inadvisable as I had originally implied.
>>>
>>
>> Do you know of any resource I could read up on returning aggregates
>> along with the existing rows?  I've never seen that before is all.
>
> Any good SQL reference will show you how to do this.  It will probably
> be somewhat less efficient if you have a lot of rows, because it has to
> put the aggregate value in each returned record, whereas if you did it
> in a separate query, it wouldn't have to return all that redundant data.
>

I think this might come in handy in this case. Either way I am going to
go dive into some code.
Many thanks for your help.  This has really helped my thinking on the
issue.

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to