[Dbix-class] Lazy Instantiation?
Matt S Trout
dbix-class at trout.me.uk
Sat Jun 16 17:29:39 GMT 2007
On Fri, Jun 15, 2007 at 04:39:11PM -0400, Steve Francia wrote:
> Doing some reading on DBIx::Class, I came across the following:
> http://www.gossamer-threads.com/lists/catalyst/users/3095
>
> > * Column values maybe "lazily loaded," meaning that are fetched from
> > the database at the last possible moment rather then being loaded up
> > front.
>
> Does this apply to relationships? eg.
> Can DBIC lazily instantiate the related objects?
> Can DBIC lazily fetch the related ids?
>
> For performance and scalability, such features would be very desirable..
> If DBIC doesn't currently support it, would anyone be interested in
> joining me it writing a patch for it?
Maybe I jumped the gun a bit here. What we -could- do that would be handy
would be to make it possible to specify a limited set of columns on
prefetch.
The other thing that might be interesting would be to find a way to lazy
load a certain set of columns in the resultset, but set things up such tht
when they're required they're fetched in a single SELECT for all objects within
that particular resultset.
Per-object lazy loading is generally inefficient, but that doesn't mean a
smarter implementation couldn't be a useful addition to our urrent approaches.
--
Matt S Trout Need help with your Catalyst or DBIx::Class project?
Technical Director Want a managed development or deployment platform?
Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/ http://www.shadowcatsystems.co.uk/
More information about the Dbix-class
mailing list