[Dbix-class] Re: how to use a complex query in DBIx::Class

Matt LeBlanc mleblanc at cpan.org
Tue Jan 2 15:19:53 GMT 2007


On 1/2/07, Matt S Trout <dbix-class at trout.me.uk> wrote:
>
> On 31 Dec 2006, at 09:25, Matt LeBlanc wrote:
>
> >
> > This would be because MySQL tends to suck the more you join. In most
> > other databases, joins tend to be much quicker with slower subqueries.
>
> Actually, databases with a decent optimiser will tend to unroll
> subqueries and the execution plan will be equivalent to the join.
> Certainly Pg's will do this in many cases.
>

Yes, if the optimizer is smart enough. Of course, then I would have to
input SQL to my SQL wrapper. ;)

> More pertinently, I suspect the join cond you want isn't currently
> achievable with DBIx::Class whereas aristotle's approach is, so I'd
> suggest going with his approach and if it turns out to be a major
> performance issue perhaps we can discuss what changes need to be made
> and how the syntax would need to be extended in order to support yours?
>

Last I checked, it isn't. I have a hacked up version of DBIx::Class
locally that allows such niceties as dynamic join conditions and
quoted order by clauses with direction (don't know if this is
currently available but it wasn't last I checked).

> --
> Matt S Trout, Technical Director, Shadowcat Systems Ltd.
> Offering custom development, consultancy and support contracts for
> Catalyst,
> DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for
> details.
> + Help us build a better perl ORM: http://dbix-
> class.shadowcatsystems.co.uk/ +
>



More information about the Dbix-class mailing list