[SERVER-77276] Push $limit stage into the PlanStage for time-series collection Created: 18/May/23  Updated: 29/Oct/23  Resolved: 16/Jun/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Arun Banala Assignee: Backlog - Query Integration
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
split to SERVER-78047 Push $limit stage into $sort pushdown... Closed
Assigned Teams:
Query Integration
Backwards Compatibility: Fully Compatible
Sprint: QI 2023-06-12, QI 2023-06-26
Participants:

 Description   

Add time-series query rewrite to push $limit into the PlanStage so that we don't fetch buckets that are not necessary

It is safe to assume that every bucket has at least one measurement. So we can rewrite an [{$_unpack}, {$limit: x}] pipeline as [{$limit: x}, {$_unpack}, {$limit: x}] . Similarly we can push the limit values inside $sort when we do $sort pushdown



 Comments   
Comment by Githook User [ 15/Jun/23 ]

Author:

{'name': 'Alice Li', 'email': 'alice.li@mongodb.com', 'username': ''}

Message: SERVER-77276 allow limit rewrite to push before bucket unpacking
Branch: master
https://github.com/mongodb/mongo/commit/e254915f83b8e1c395f87703b8adc471af8efdac

Generated at Thu Feb 08 06:35:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.