-
Type:
Bug
-
Resolution: Works as Designed
-
Priority:
Critical - P2
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Integration
-
ALL
-
-
None
-
None
-
None
-
None
-
None
-
None
-
None
When I run this query I should see memory metrics for the group stage, but I do not:
db.cpu.explain('executionStats').aggregate([ { $match: { "tags.cpu": "cpu0" } }, { $group: { _id: { $dateTrunc: { date: "$timestamp", unit: "hour" } }, avgNonIdle: { $avg: { $subtract: [100, "$usage_idle"] } } } }, { $project: { _id: 0, time: "$_id", avgNonIdle: 1 } }, { $sort: { time: 1 } } ]);
This query is on a collection produced by running telegraf configured to send CPU metrics to MongoDB.
The output from explain('executionStats') looks like this, in part:
{
...
inputStage: {
stage: "block_group",
...
peakTrackedMemBytes: 0,
...
}
}
For some reason it's not showing any memory used for the query, but there should be at least some. We should understand why. If I put $_internalInhibitOptimization between the match and the group stage, it uses the classic version of $group which does show memory usage.