How to find queries not using indexes or slow in mongodb

后端 未结 6 1341
轻奢々
轻奢々 2020-12-08 05:00

is there a way to find queries in mongodb that are not using Indexes or are SLOW? In MySQL that is possible with the following settings inside configuration file:

         


        
6条回答
  •  借酒劲吻你
    2020-12-08 05:38

    The equivalent approach in MongoDB would be to use the query profiler to track and diagnose slow queries.

    With profiling enabled for a database, slow operations are written to the system.profile capped collection (which by default is 1Mb in size). You can adjust the threshold for slow operations (by default 100ms) using the slowms parameter.

提交回复
热议问题