Performance gain by using bulk inserts vs regular

2019-04-24 11:15发布

问题:

What is the performance gain by using bulk inserts vs regular inserts in MongoDB and pymongo specifically. Are bulk inserts just a wrapper for regular inserts?

回答1:

Bulk inserts are no wrappers for regular inserts. A bulk insert operation contains many documents sent as a whole. It saves as many database round trips. It is much more performant since you don't have to send each document over the network separately.



回答2:

@dsmilkov Thats an advantage as you dont have to open a connection every single time.