On Dec 4, 2012, at 4:32 PM, Diego Woitasen wrote:

> 
> 
> 
> 
> 
> 
> 
> I'm mixing ORM and Core in my app because I performance in critical in some 
> parts of the code. Are there other problems related to this mix? 

I wouldn't call them "problems", but to the degree that you're using plain Core 
functions you just won't get ORM awareness of that.  If for example you emitted 
a bunch of INSERT, UPDATE, DELETE statements, the objects loaded into your ORM 
session wouldn't be aware of those changes until a refresh.

I'd also say it's not a given that the ORM needs to be bypassed for 
"performance critical" features, the performance issue of the ORM Query object 
is that loading rows into full fledged Python objects is a slow process.  So if 
you need to run a query and get non-object results back, Query can run against 
individual columns, and you'll get SELECT performance that's more or less the 
same as you get from using Core directly, i.e.:

session.query(MyClass.x, MyClass.y)....

the Query has a little more overhead in constructing the underlying select() 
construct than doing it directly, so I guess it depends on what specific 
performance issues you were seeing.


-- 
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 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to