<br><div><span class="gmail_quote">On 8/10/06, <b class="gmail_sendername">Ash Berlin</b> &lt;<a href="mailto:ash@cpan.org">ash@cpan.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Right then guys:<br><br>I am trying to build the following query:<br>[......]<br>Any recourse?</blockquote><div><br>I don't think you've got enough join/prefetch's in your DBIC version to be doing what you want it to do.&nbsp; All total, there should be three JOIN operations taking place.
<br><br>I would suggest re-writing your original query using real JOINs first, then attacking it from DBIC.&nbsp; 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.&nbsp; 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).&nbsp; DBIC will always generate explicit JOIN syntax.
<br><br>-- Brandon<br></div></div>