Camping and DBI

Lennon Day-Reynolds rcoder at gmail.com
Sun Jan 28 21:54:48 EST 2007


On 1/27/07, James <jamesd.earl at gmail.com> wrote:
> [...]
> I'll probably end up using ActiveRecord.  I just get caught up
> sometimes in the memory game, and hate seeing my memory usage sky
> rocket as I pull large results.  But if I have the memory, why not use
> it to my advantage!

This is one of the biggest issues with ActiveRecord, in my opinion:
i.e., having to instantiate all your model objects before iterating
over them. It's not just a question of RAM -- the load on the database
server and network traffic are significant, too. Using DBI, you should
be able to do more intelligent iteration over result sets -- esp. if
you pass actual database cursor handles from your models to
controller, instead of pre-fetching everything.

-Lennon


More information about the Camping-list mailing list