[Dbix-class] prefetching multi

Will Hawes info at whawes.co.uk
Fri Apr 7 10:42:15 CEST 2006


Mark Hedges wrote:
> Weird.  I can do:
> 
>     { prefetch => { some_hasmany => 'their_hasone' } }
> 
> and all objects are populated without further queries when I 
> call the accessors, but if I do this:
> 
>     { prefetch => 'some_hasmany' },
> 
> The first SQL calls up the full set of answers, but when I 
> iterate through while (my $thing = $rs->next), if I call 
> $thing->some_hasmany, it does another query for each one anyway.

I get the same behaviour and it's confusing me also. I did try to raise 
this with Matt on IRC the other day, but I think he missed it.



More information about the Dbix-class mailing list