> But to ask otherwise, is there anybody else who has experienced
> similar performance problems when accessing lots of heavy eagerloaded
> sqlalchemy models wich are all already in the memory?

My app does quite a bit of heavy eagerloading in a lazy as-needed fashion,
and then clears the session used to load the data and leaves the
now-unpersisted data in cache. Works fine and runs quite quickly. For even
faster loads, you can bypass the ORM and use the relational layer directly.
The relational layer can in some instances perform much faster than ORM
access, albeit with less convenience. Using sqla's relational layer doesn't
have much of a performance hit than using the DB-API directly.

If in your app you are accessing the cached data without a follow-on query
on each web hit, it may be that you never cleared the instances from the
session, and so they are thus still persistent and will reload from the DB
in certain instances.

If on the other hand your design is to incur a DB hit on each and every web
hit, then you will probably have better luck tuning the query itself and
using the relational layer than looking for the answer in tuning or tweaking
the ORM. Your profile looks as though it's spending most of its time with
processing attributes. Using the relational layer and working directly with
native Python types would eliminate that.


Rick

--~--~---------~--~----~------------~-------~--~----~
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