i'm trying to insert 60k rows in mysql but this takes 10 minutes to complete
for obj in parsed_objs:
key = 'randomstring'
mysqlc.execute("""
REPLACE INTO infos
(`key`, `value`)
VALUES
(%(key)s, %(value)s)
""", {'key':key, 'value':obj['val']})
mysqlc.connection.commit()
does this is a good way to do this?
when I run commit(), the script runs separated queries or merges all?
Maybe a good idea should be build one unique string like this?
insert into table my_table(col1, col2) VALUES (val1_1, val2_1), (val1_2, val2_2);