[Dbix-class] might_have vs has_one

Matt S Trout dbix-class at trout.me.uk
Sat Jun 23 16:18:01 GMT 2007


On Fri, Jun 22, 2007 at 09:54:14PM +0530, Ramprabhu Kaliaperumal wrote:
> What does it make difference if we use might_have or has_one.
> Document says its LEFT_JOIN and INNER_JOIN difference.
> 
> I dont se any difference when I use then in code. Both give me same result.

an INNER join will usually perform better, but if the right hand side is
optional it won't give correct results.

So has_one is effectively a better-performing might_have for situations where
you know there's always a record on the other side.

-- 
      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