mongo慢查询

发布时间:2013-12-08 08:00:01 阅读:1305次

profile

> db.getProfilingLevel()
0
> db.getProfilingStatus();
{ "was" : 0, "slowms" : 100 }
> db.setProfilingLevel(1)
{ "was" : 0, "slowms" : 100, "ok" : 1 }
> db.getProfilingStatus();
{ "was" : 1, "slowms" : 100 }
> db.getProfilingLevel() 
1
>
> db.getProfilingLevel(1,1000)  
1
> db.getProfilingStatus();      
{ "was" : 1, "slowms" : 1000 }
>
> db.system.profile.find();                                                              
{ "ts" : ISODate("2013-11-17T13:26:37.639Z"), "info" : "query siyuroom.$cmd ntoreturn:1 command: { $eval: CodeWScope( function (){ return db.getCollectionNames(); }, {}), args: {} } reslen:211 109ms", "millis" : 109 }
{ "ts" : ISODate("2013-11-17T13:26:40.413Z"), "info" : "query siyuroom.$cmd ntoreturn:1 command: { dbstats: 1 } reslen:213 341ms", "millis" : 341 }
{ "ts" : ISODate("2013-11-17T13:29:28.016Z"), "info" : "query siyuroom.v9_picture_favorite reslen:68758 nscanned:125606  \nquery: { username: \"test\" }  nreturned:101 1165ms", "millis" : 1165 }
> db.system.profile.find().sort({$natural:-1}).limit(1);
{ "ts" : ISODate("2013-11-17T13:29:28.016Z"), "info" : "query siyuroom.v9_picture_favorite reslen:68758 nscanned:125606  \nquery: { username: \"test\" }  nreturned:101 1165ms", "millis" : 1165 }
>

如有问题,可以QQ搜索群1028468525加入群聊,欢迎一起研究技术

支付宝 微信

有疑问联系站长,请联系QQ:QQ咨询

转载请注明:mongo慢查询 出自老鄢博客 | 欢迎分享