He means there's no way to do custom eager loading.  Namely, a find_by_sql
(or any find call without :include for that matter) only ever instantiates
models of a single type.  There is a much larger class of performance
problems that can be solved by allowing instantiation of arbitrary models
out of any given query (ie. model graphs based on dev-supplied JOINs).
Personally I believe this should be possible not only with find_by_sql, but
also find + :joins/:select, since that allows the developer to continue
leveraging the power of AR query generation which I rely upon heavily in my
current project.

I'm working on a solution to this, but I have quite a few deadlines to get
through before I can devote serious energy to it.  The hard part is figuring
out what the interface should look like.

On 8/21/07, Mark Reginald James <[EMAIL PROTECTED]> wrote:
>
>
> Michael Koziarski wrote:
>
> > I'm personally not sold on this particular optimisation technique.  I
> > think the real problem here is that it's still too hard to load a
> > graph of objects out of a find_by_sql call.  If that were fixed you'd
> > be able to optimise cases like this, without too much complication to
> > AR's codebase.
>
> Michael, would you be able to expand on this?
>
> --
> We develop, watch us RoR, in numbers too big to ignore.
>
>
> >
>


-- 
Gabe da Silveira
http://darwinweb.net

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to