Artist.find(:first)
results in this SQL:
SELECT * FROM artists LIMIT 1
whereas
Artist.find(:first, :include => :label)
results in
SELECT artists.`id` AS t0_r0, artists.`name` AS t0_r1, artists.`location_id` AS t0_r2, artists.`type` AS t0_r3, artists.`label_id` AS t0_r4, artists.`image_id` AS t0_r5, artists.`info` AS t0_r6, artists.`summary` AS t0_r7, artists.`ordername` AS t0_r8, labels.`id` AS t1_r0, labels.`name` AS t1_r1, labels.`type` AS t1_r2, labels.`link_id` AS t1_r3, labels.`image_id` AS t1_r4, labels.`location_id` AS t1_r5, labels.`info` AS t1_r6 FROM artists LEFT OUTER JOIN labels ON labels.id = artists.label_id
Note the lack of a LIMIT clause. This means that MySQL performs the join on the entire artists table, and returns every row of the table, taking quite some time for what should be a really quick query. With tables holding millions of rows this is quite a performance problem.
I'm guessing this should be an easy fix, as explicity adding in a :limit => 1 parameter to the find seems to do the job.