扫码关注官方订阅号
在命令行中操作mongodb,db.testrests.find({})要想知道这条语句的时间,要怎么查看那?
db.testrests.find({})
1、find操作请直接使用explain,例如:
db.tablename.find().explain( "executionStats" ) 关注输出的如下数值:explain.executionStats.executionTimeMillis
2、Update/delete/insert操作,请设置profile,然后查看日志,例如:
db.setProfilingLevel(2) db.getProfilingLevel() db.system.profile.find()
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
1、find操作请直接使用explain,例如:
2、Update/delete/insert操作,请设置profile,然后查看日志,例如: