> > > The inserts I do is as follows: > > > BEGIN: > > > 2009-02-13 14:34:40,703 INFO > > > sqlalchemy.engine.base.Engine.0x..10 UPDATE data SET status=? > > > WHERE data."index" = ? > > > 2009-02-13 14:34:40,703 INFO > > > sqlalchemy.engine.base.Engine.0x..10 ['True', 68762] > > > > > > ... > > > (1000) > > > ... > > > > > > COMMIT > > > > > > Please note that the SET values are constant and only index > > > changes. > > > > can u use > > ... where data.index in (...) ? > > or if not, > > ... where data.index == 1 or data.index == 2 or ... > > group them by say 10 or 20, and see how faster that is? > > Thank you for the quick reply. Your point seems very good. > > Actually, I use SQLAlchemy's Identity Mapper to do the same. > The code I use is as follows: > > for o in self.objects: > o.status = txt > self.session.add(o) > self.session.commit() > > This acutally causes the SQLAlchemy to write separate UPDATE > statements. > I went through SQLAlchemy tutorial - and I couldnt find a mechanism > to cause it to update DB for multiple indexes in a single > statement. > > Is it possible to do it via Identity Mapper? > If not, if I modify it using SELECT statements, wont this session > have erroneous values?
hmm... group ORM updates... no idea, wait for Mike. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---