`
san_yun
  • 浏览: 2652181 次
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

MongoDB 哪些地方会产生锁?

 
阅读更多

Which operations lock the database?

原文:http://docs.mongodb.org/manual/faq/concurrency/#what-type-of-locking-does-mongodb-use

 

The following table lists common database operations and the types of locks they use.

 

Operation Lock Type
Issue a query Read lock
Get more data from a cursor Read lock
Insert data Write lock
Remove data Write lock
Update data Write lock
Map-reduce Read lock and write lock, unless operations are specified as non-atomic. Portions of map-reduce jobs can run concurrently.
Create an index Building an index in the foreground, which is the default, locks the database for extended periods of time.
db.eval() Write lock. db.eval() blocks all other JavaScript processes.
eval Write lock. If used with the nolock lock option, the eval option does not take a write lock and cannot write data to the database.
aggregate() Read lock
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics