On Mon, Sep 28, 2009 at 6:18 PM, Marnen Laibow-Koser
<rails-mailing-l...@andreas-s.net> wrote:
> Frederick Cheung wrote:
> [...]
>>> That's going to iterate over all of the records. �twice! �in interpreted 
>>> code!
>>
>> partition will do it in one
>
> Hey, that's good to know!
>
> If you need to do the partitioning in the DB, you could use ORDER BY
> abs(id - :magic_id).  That way the first record will be the magic one.

Oh that's clever!  I like that!

Thanks.

--wpd

--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to