mongo慢查询

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 }
>

    A+
发布日期:2013年12月08日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: