[Dbix-class] Multiple belongs_to relationships referencing same class

Tobias Kremer list at funkreich.de
Wed May 2 17:30:19 GMT 2007


> * Tobias Kremer <list at funkreich.de> [070502 09:10]:
> > Have you tried your approach with a user table that has approximately
> > 250.000 entries? Unfortunately, the resulting LEFT JOIN with OR condition
> > on this table takes about 10 seconds on my system because MySQL considers
> > all rows from the user table :( Any ideas on how to optimize this?
>
> Have you created an index for each of the user id columns?

Of course :) The problem is rather the left join (with OR condition) on the
user table (not the where condition on the friendship table).

--Tobias



More information about the Dbix-class mailing list