Performance gain by using bulk inserts vs regular inserts in MongoDB

不羁岁月 提交于 2020-01-02 02:02:04

问题


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.



来源:https://stackoverflow.com/questions/16533420/performance-gain-by-using-bulk-inserts-vs-regular-inserts-in-mongodb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!