[SERVER-78235] pushdown $group ahead of unpack with $count Created: 20/Jun/23  Updated: 29/Oct/23  Resolved: 11/Aug/23

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

Type: Task Priority: Major - P3
Reporter: Gil Alon Assignee: Gil Alon
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
depends on SERVER-78234 extend min/max pushdown for $group fo... Closed
Problem/Incident
causes SERVER-80562 Timeseries group rewrite blocks count... In Code Review
Assigned Teams:
Query Integration
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.0, v6.0
Sprint: QE 2023-08-07
Participants:

 Description   

This is a follow-up ticket to SERVER-78234 to extend the optimization that exists for $group with min/max to $group that uses $count. For v2 buckets we can use control.count, and for v1 buckets we need to compute based on the timeField.



 Comments   
Comment by Gil Alon [ 30/Aug/23 ]

Based on WRITING-14930 we see 139x in performance when the buckets are compact and 71x improvement in tsbs data with this optimization. Since control.count was added in 5.2, we can implement this rewrite in versions 6.0 and 7.0.

Comment by Githook User [ 11/Aug/23 ]

Author:

{'name': 'Gil Alon', 'email': 'gil.alon@mongodb.com', 'username': 'galon1'}

Message: SERVER-78235 Rewrite $group with $count accumulator for timeseries collections
Branch: master
https://github.com/mongodb/mongo/commit/0c366ea804e60559d82d499ee9e8bdf77753639c

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