[SERVER-57556] $_internalUnpackBucket to return single min/max doc Created: 08/Jun/21  Updated: 06/Dec/22  Resolved: 15/Mar/22

Status: Closed
Project: Core Server
Component/s: Query Planning
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Ruslan Abdulkhalikov (Inactive) Assignee: Backlog - Query Optimization
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Query Optimization
Participants:

 Description   

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.



 Comments   
Comment by Steve Tarzia [ 15/Mar/22 ]

Actually, I heard that $_internalUnpackBucket with a $sort + $limit:1 will just do a O time scan, so the work described in this ticket is apparently already done.

Generated at Thu Feb 08 05:42:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.