Created
November 26, 2017 07:12
-
-
Save bosukh/70f19e966664115e6322fac750d17cf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
def test_mysql_update(n=100000): | |
init_sqlalchemy(False) | |
t0 = time.time() | |
for i in xrange(n): | |
DBSession.execute( | |
"UPDATE customer SET name = '{0}' WHERE '{1}'".format( | |
'NEW_NAME ' + str(i), str(i) | |
) | |
) | |
DBSession.commit() | |
print( | |
"mysql: Total time for " + str(n) + | |
" records " + str(time.time() - t0) + " sec") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment