-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
Fully Compatible
-
105
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Given a simple timeseries collection:
./build/install/bin/mongod --setParameter featureFlagSbeFull=true --setParameter featureFlagTimeSeriesInSbe=true --setParameter logComponentVerbosity='{query: 5}' > db.coll.drop() > db.createCollection("coll", {timeseries: {timeField: "t"}}) > db.coll.insert({t: new Date(), a: 4, b: 7, c: 5}) > db.coll.insert({t: new Date(), a: 2, b: 9, c: 8}) > db.coll.insert({t: new Date(), a: 3, b: 1, c: 6}) ..
The goal of this task is to get the following queries working in block-processing mode (and to write a jstest that verifies it works). A $match is needed before the $group to force block processing, as without it the $group will use the Time Series bucket metadata to satisfy $min and $max queries without unpacking the buckets and thus without any block processing. allowDiskUse must also be set to false as block processing is only supported in this case:
> db.coll.aggregate([{$match: {a: {$gt: 0}}}, {$group: {_id: null, x: {$min: "$a"}}}], {allowDiskUse: false})
> db.coll.aggregate([{$match: {a: {$gt: 0}}}, {$group: {_id: null, x: {$max: "$a"}}}], {allowDiskUse: false})
> db.coll.aggregate([{$match: {a: {$gt: 0}}}, {$group: {_id: "$c", x: {$min: "$a"}}}], {allowDiskUse: false})
> db.coll.aggregate([{$match: {a: {$gt: 0}}}, {$group: {_id: "$c", x: {$max: "$a"}}}], {allowDiskUse: false})
- is duplicated by
-
SERVER-84489 [BP] Support group-by $min/$max with multiple buckets
-
- Closed
-
-
SERVER-86122 Make SBE stage builder support compound/multiple accumulators for block-based $group
-
- Closed
-
-
SERVER-86127 Add a check to avoid using BlockHashAggStage when a collation is set
-
- Closed
-
-
SERVER-86130 Add a check to avoid using BlockHashAggStage with accumulators that aren't supported
-
- Closed
-