Hi all,
I am trying to analyze the query execution plan to drill down into the use of some indexes but using the $planCacheStats command I am not getting all the information I would expect.
I am using a server with MongoDb 4.2 and running the following command
db.getCollection("test").aggregate( [
{ $planCacheStats: { } }
] )
with the database root user, I get this information:
[
{
"queryHash" : "60879Z27",
"planCacheKey" : "E72AZZA6",
"isActive" : true,
"works" : 12,
"timeOfCreation" : ISODate("2023-04-21T15:27:07.473+0000"),
"indexFilterSet" : false,
"estimatedSizeBytes" : 70964
}
{
"queryHash" : "F70XYDE4",
"planCacheKey" : "C98ZZ425",
"isActive" : true,
"works" : 2,
"timeOfCreation" : ISODate("2023-04-21T14:32:39.608+0000"),
"indexFilterSet" : false,
"estimatedSizeBytes" : 60312
}
{
"queryHash" : "0XY01C75",
"planCacheKey" : "7232ZZ56",
"isActive" : false,
"works" : 14,
"timeOfCreation" : ISODate("2023-05-17T07:13:12.752+0000"),
"indexFilterSet" : false,
"estimatedSizeBytes" : 61997
}
...
]
The values createdFromQuery, cachedPlan, … are not returned as shown in documentation https://www.mongodb.com/docs/manual/reference/operator/aggregation/planCacheStats/#output
Does anyone know the reason for this behavior?
Thank you in advance
A