I need to load a lot of data into a MySQL database. For most models, I use django ORM, but one of my models will have billions (!) Instances, and I would like to optimize its insert operation.
It seems I canโt find a way to make executeemany () work, and after googling it seems that there are almost no examples there.
I am looking for the correct sql syntax + the correct command syntax + the correct value data structure to support the executeemany command for the following sql statement:
INSERT INTO `some_table` (`int_column1`, `float_column2`, `string_column3`, `datetime_column4`) VALUES (%d, %f, %s, %s)
Yes, I explicitly specify id (int_column1) for efficiency.
A short code example will be great
sql django mysql insert
Jonathan Nov 28 '10 at 18:29 2010-11-28 18:29
source share