[Dbix-class] Chaining searches with joins on the same table

A Murka amurkat at gmail.com
Fri Jul 10 15:39:47 GMT 2009


On Fri, Jul 10, 2009 at 9:59 AM, Rob Kinyon<rob.kinyon at gmail.com> wrote:
> On Fri, Jul 10, 2009 at 00:08, A Murka<amurkat at gmail.com> wrote:
> [snip]
>> Do I just have to create a method that does both joins at once? Is a
>> better way to implement these aggergates?
>
> There is such a thing as putting too much into one query. These
> queries do very different things. So, just do two queries. Simplify
> your life.

The trouble with that is that it would mean making an extra query for
each image as it's displayed: one to select all the images, then one
for each to select the user's rating for it. On a thumbnail page with
many images, this would mean many extra queries.



More information about the DBIx-Class mailing list