On 8/10/06, Ash Berlin <[EMAIL PROTECTED]> wrote:
I don't think you've got enough join/prefetch's in your DBIC version to be doing what you want it to do. All total, there should be three JOIN operations taking place.
I would suggest re-writing your original query using real JOINs first, then attacking it from DBIC. I know Pg accepts what you've got (maybe other DBs do too?) by basically running a query analysis and then creating what it thinks is the optimal set of JOINs for your list of tables and WHERE conditions. But it will be easier to see the discrepancies if you specify your JOINs explicitly (its also easier to tune your queries for performance that way). DBIC will always generate explicit JOIN syntax.
-- Brandon
Right then guys:
I am trying to build the following query:
[......]
Any recourse?
I don't think you've got enough join/prefetch's in your DBIC version to be doing what you want it to do. All total, there should be three JOIN operations taking place.
I would suggest re-writing your original query using real JOINs first, then attacking it from DBIC. I know Pg accepts what you've got (maybe other DBs do too?) by basically running a query analysis and then creating what it thinks is the optimal set of JOINs for your list of tables and WHERE conditions. But it will be easier to see the discrepancies if you specify your JOINs explicitly (its also easier to tune your queries for performance that way). DBIC will always generate explicit JOIN syntax.
-- Brandon
_______________________________________________ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class Wiki: http://dbix-class.shadowcatsystems.co.uk/ IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/ Searchable Archive: http://www.mail-archive.com/[email protected]/
