Oh, and I meant to mention, in comparison to my proposed solution, this
one executes one query whereas mine executes (total number of rows /
100) queries.

What's bad with mine is that MySQL does the query on the whole table on
every loop and then just sends you the batch you asked for.  With a big
table, this is really bad.

Anyone know a good way of having ActiveRecord models do this kind of
execute and fetch on each, rather than get the whole lot at the start?
It's clearly preferable sometimes.

John.

On Thu, 2008-10-02 at 12:19 +0100, Carl Drinkwater | 29degrees wrote:
> Hi John,
> 
> > Nice - that's a very tidy solution.  I'm assuming the each method on  
> > res
> > fetches the rows one at a time from the MySQL server, rather than
> > grabbing them all at once.
> 
> Yeah, exactly.
> 
> Regards,
> Carl.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"NWRUG" 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/nwrug-members?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to