当前位置:Gxlcms > 数据库问题 > Mongodb 实践

Mongodb 实践

时间:2021-07-01 10:21:17 帮助过:13人阅读

Mongodb 慢查询分析

db.setProfilingLevel(1)
db.setProfilingLevel(1,1000)
db.getProfilingStatus()

查看记录下来的耗时语句
db.system.profile.find()

其中,"ts" : ISODate("2018-03-28T01:53:10.779Z")为执行命令时间:
db.system.profile.find().sort({ts:-1})

通过explain()查看index使用情况
db.getCollection(‘collection_name‘).find({"insertTime" : {"$gte":ISODate("2018-02-06T05:47:00.267Z"), "$lte":ISODate("2018-03-06T05:47:00.267Z")}}).explain()

Mongodb 实践

标签:dex   情况   实践   cti   eve   分析   sort   evel   mongodb   

人气教程排行