[Dbix-class] totally simplified example of my prefetch problem.

Matt S Trout dbix-class at trout.me.uk
Mon Aug 14 19:54:19 CEST 2006


George Hartzell wrote:
> I've put together a dead-simple example that demonstrates the problem
> that I'm having using prefetch.  Three tables, 4 rows of data in
> total, simple driver script, etc....

You can only prefetch one "direction" of has_many rels at once. Anything else 
results in a cross-product return of records which tends to be heinously 
inefficient anyway.

i.e.

[ 'hm_rel', 'other_hm_rel' ] won't work

although

[ { 'hm_rel' => { 'belongs_to_rel' => 'ya_hm_rel' }, 'other_belongs_to_rel' ]

and similar are fine.



More information about the Dbix-class mailing list