In case when I need to run many updates to database in long cycle,
what is preferred for speed - to have one db.commit() at the end or
commit() after every db update?

E.g.

for i in range(100000):
    db(db.details.id==i).update(**dict([(destination_field, i)]))
    db.commit()

or

for i in range(100000):
    db(db.details.id==i).update(**dict([(destination_field, i)]))
db.commit()



(this is an example only, of course condition db.details.id==i is
dumb).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to