[Dbix-class] trouble with using 'select' in a search clause

Matt S Trout dbix-class at trout.me.uk
Thu May 18 14:31:26 CEST 2006

Toby Corkindale wrote:
> On Thu, May 18, 2006 at 01:11:46AM -0700, John Napiorkowski wrote:
>> To be honest I am sure part of my problem is ignorance
>> about the best way to use DBIx.  So your suggestions
>> of any type are useful.  I've been using SQL for quite
>> a long time and writing a statement like the one I
>> show below is a very normal way for me to think.  My
>> instinct is to try and get all the data I want in a
>> single statement, since my training in SQL pushed me
>> to consider performance issue.
> I've entered the DBIx::Class arena from the same background as you..
> I've used to hand-crafting large SQL queries, with the emphasis being on
> performance, data normalisation, and avoiding long locks due to transaction
> serialisation.
> I don't believe DBIx::Class will ever have the performance of pure hand-crafted
> SQL, when used in complex situations. However, that's like saying that C++
> won't have the performance of hand-written assembler - ie. It's true, but there
> isn't a huge amount in it, and no-one is going to write large programs in pure
> assembler, and you can always insert small pieces here and there if needs be
> anyway.
> DBIx::Class encourages you to think of your data as the conceptual related
> objects they really are.

... but if you can't persuade it to run something that's at least *almost* 
equivalent to the pure hand-crafted SQL you would have done anyway, I want to 
know what the difference is so I can hack it in as a supported feature.

DBIC puts a lot more emphasis on that than I think any other perl ORM does - 
native GROUP BY and HAVING support being something I think is unique to us 
currently, and I have every intention of getting subqueries, EXISTS and NOT 
EXISTS clauses working soon.

      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

More information about the Dbix-class mailing list