On 5/8/07, Michael Bayer <[EMAIL PROTECTED]> wrote:
>
>
> On May 8, 2007, at 8:47 PM, Mike Orr wrote:
>
> >
> > I noticed the ORM was taking a few seconds longer in my batch job.
> >
> > Today I converted my web application from Select to ORM so I could add
> > some methods to the mapped classes, and even tried a relationship with
> > a backreference (!).  That worked fine, but I notice it's doing nested
> > selects again.

...

> I guess im giong to have to find a way to back this up, but its my
> belief that the database should be pretty good at optimizing nested
> selects such that it doesnt make a whole lot of difference.
> otherwise people would never use views.

I tested it today and the ORM version sometimes takes six seconds to
display a page while the non-ORM version always takes less than a
second.    The longer times correspond to pages with the most result
records that haven't been viewed since the application (Pylons) was
restarted.  But sometimes the delays don't happen even under the same
conditions, so I'll have to monitor it for a while.  If it takes a few
extra seconds after the app is started, that's fine, as long as it
isn't happening all the time.

The non-ORM version has functions that create a base select with a
limited number of fields, then the caller adds clauses to it.  It also
doesn't have a relation, but the ORM SQL isn't actually using a
relation either.

-- 
Mike Orr <[EMAIL PROTECTED]>

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

Reply via email to