# PMM QAN MongoDB -- Explain is working randomly

**URL:** <https://forums.percona.com/t/pmm-qan-mongodb-explain-is-working-randomly/30706>\
**Category:** PMM 2.x\
**Tags:** pmm, mongodb\
**Created:** [May 30, 2024, 10:52am UTC](https://forums.percona.com/t/pmm-qan-mongodb-explain-is-working-randomly/30706 "2024-05-30T10:52:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrei\_Zhidkov](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/andrei_zhidkov/32/11425_2.png) [@Andrei\_Zhidkov](https://forums.percona.com/u/Andrei_Zhidkov)\
**Post date:** [May 30, 2024, 10:52am UTC](https://forums.percona.com/t/pmm-qan-mongodb-explain-is-working-randomly/30706/1 "2024-05-30T10:52:04Z")

</div>

## Description:

The PMM QAN Explain is not working in most cases. Even for Find statements.  
We have profile enabled fpr slow op only at systems lvl.  
operationProfiling:  
mode: slowOp  
slowOpSampleRate: 0.1  
slowOpThresholdMs: 200

The query is visible on the QAN dashboard and in system.profile collection. The details and Example tabs are working fine. However. explain is hanging for couple minutes and failed with the following error:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/3X/c/1/c16f9ec0fc9db62417c8f590efd8bdab30927a96.png)

FYI: for some queries we are able to pick up the explain plan. Same cluster , different db.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/3X/5/7/5707d8ca9bb67d7ca5afb246e507d0532248033f.png)

Please, advise.

Thanks,

---

<div class="post-metadata">

**Author:** ![nurlan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/nurlan/32/1523_2.png) [@nurlan](https://forums.percona.com/u/nurlan)\
**Post date:** [May 30, 2024, 11:45am UTC](https://forums.percona.com/t/pmm-qan-mongodb-explain-is-working-randomly/30706/2 "2024-05-30T11:45:43Z")

</div>

Hello, we are going to revisit QAN explain for MongoDB in 2.43.0.  
Could you share queries that doesn’t work?

---

<div class="post-metadata">

**Author:** ![Andrei\_Zhidkov](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/andrei_zhidkov/32/11425_2.png) [@Andrei\_Zhidkov](https://forums.percona.com/u/Andrei_Zhidkov)\
**Post date:** [May 30, 2024, 1:00pm UTC](https://forums.percona.com/t/pmm-qan-mongodb-explain-is-working-randomly/30706/3 "2024-05-30T13:00:54Z")

</div>

Hello,  
Here is couple examples:  
FIND scheduled-buy-rates Applied,Effective  
FIND transactions DeliveryMethod.Payer.AlternativeId,Status,Updated

From Pmm the following is visible:  
FIND scheduled-buy-rates Effective,Revisions.0

Same query in system.profile

`````auto
command:{
        "find" : "scheduled-buy-rates",
        "filter" : {
                "Effective" : {
                        "$gte" : ISODate("0001-01-01T00:00:00Z"),
                        "$lte" : ISODate("2024-05-30T05:42:31Z")
                },
                "Applied" : null
        },
        "projection" : {
                "Revisions" : 0
        },
        "skip" : 0,
        "limit" : 2147483647,
        "readConcern" : {
                "level" : "majority"
        },
        "$db" : "pricing-qa",
        "$readPreference" : {
                "mode" : "primaryPreferred"
        },
````Preformatted text`
`````
