【MongoDB】管理命令收集
// 开启2000毫秒以上的慢查询记录 db.setProfilingLevel(1,2000)// 查看最近5条慢查询
show profile
// 按照慢查询执行时间倒序查询
db.system.profile.find().sort({'millis':-1}).pretty
// 查看查询计划
db.Sync_Log.find({"$and":[{"mbid" :{$eq 7542163}},{'t':{$gte:2333}}]}).explain()
// 关闭慢查询记录
db.setProfilingLevel(0)
页:
[1]