Hi guys currently i am trying to migrate current db to another and that process unfortunately involves python. I was able to do it single threaded, but it's incredibly slow took hours to finish 1M data. Is there similar method in python like Java executor and futures?
note that user_list is a chunk of 1000/1M
for data in user_list:
q = """ insert into users(id,name,address,password)
Values({id},{name},{address},{password})
""".format(id=data['id'],name=data['name'],address=data['address'],password=data['password'])
db.command(q)
I think it would be a whole lot faster if i run for example 8 concurrent threads inserting 8 at a time instead of single thread doing single insert