Hi,

I'm having problems when I combine Class table inheritance with eager
graph. Which creates a subselect with all the "bloggers" (see gist)
where it joins in the user table. Which makes this query really slow.

Here's a code example:
https://gist.github.com/cd45201eb1e856590243

Here's the generated query:
SELECT `users`.`user_id`, `users`.`blogger_custom_field`,
`blog`.`blog_id`, `blog`.`user_id` AS `blog_user_id`,
`blog`.`blog_custom_field`
FROM (
  SELECT * FROM `users`
  INNER JOIN `bloggers` USING (`user_id`)
) AS `users`
LEFT OUTER JOIN `blogs` AS `blog` ON (`blog`.`user_id` =
`users`.`user_id`)

Here's how I would like it:
SELECT `users`.`user_id`, `bloggers`.`blogger_custom_field`,
`blog`.`blog_id`, `blog`.`user_id` AS `blog_user_id`,
`blog`.`blog_custom_field`
FROM users (
INNER JOIN `bloggers` USING (`user_id`)
LEFT OUTER JOIN `blogs` AS `blog` ON (`blog`.`user_id` =
`users`.`user_id`)

Is there something that I can change to make it work this way or is
this a bug?

Thanks!

Cheers,
Patrick

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to