查询性能分析

文档总数:
MongoDB索引建立以及查询性能分析
执行性能分析

db.user_login_log.find({
    id: "11598978",
    month: "201902"
}).explain('executionStats') 

未加索引前:

MongoDB索引建立以及查询性能分析
查询需要耗费173ms

加索引后:

在用户id字段和月份字段添加索引,注意:后台添加索引,否则可能锁库
db.集合名.createIndex({"字段名":1},{"name":'字段名_',background:true})
MongoDB索引建立以及查询性能分析

相关文章:

  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
  • 2021-12-27
  • 2021-11-29
猜你喜欢
  • 2022-01-06
  • 2021-09-21
  • 2022-01-04
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
相关资源
相似解决方案