-
Type: New Feature
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Query Planning
-
None
-
Query Optimization
This ticket is optional for PM-2330.
SERVER-9507 lets us avoid a full index scan when $group and $first/$last are used together. PM-2330 extends this optimization to timeseries collections, however it still unpacks the entire bucket containing the first/last data (with $internalUnpackBucket) and then uses a $sort and $last.
It would be more efficient to have a bucket access operator that directly returned the document for the min/max timestamp.