hongqn/umysqldb — pull request #3 by fried (2013-07-04 21:40:32+00:00)
Title: Bulk Insert handling for executemany

Was trying to do bulk inserts and was getting horrible performance. Looked at executemany and notice in horror it turned my bulk insert into single inserts. These changes fall in line with how MySQLdb module hangles them.

I saw a 99% reduction in the time it took to insert 3854 rows from ~260s to <2 seconds. Over 500x increase in the number of rows inserted per second in my tests

The only thing i don't like is that we have to do client side escaping. I guess we could build a query with a bunch of (%s, %s, %s), (%s, %s, %s) and flatten args and pass it to execute. I'll try that and see how it preforms.