Hi,

On Fri, Feb 13, 2009 at 7:26 AM, MikeCo <mconl...@gmail.com> wrote:

The ORM will probably have a little bit of function call overhead compared
to the SQL Expression Language, and that may no longer be the case.
 Regardless with the ORM you're going to want to use the update method as
stated by MikeCo along with the IN syntax so you get batch updating.  With a
1000 items you will likely run into SQL command length issues so you'll
probably need to batch them as az said.

You should end up with something like:

>>> bar = [1, 2, 3]
>>> session.query(Post).filter(Post.id.in_(bar)).update({'title':'updated'},
synchronize_session=False)
3

I'd be interested to see what your analysis uncovers.

-- 
Michael Trier
http://blog.michaeltrier.com/
http://thisweekindjango.com/

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