[SERVER-79066] Investigate why $group rewrite based on controls in TS isn't lowered to SBE Created: 18/Jul/23 Updated: 29/Oct/23 Resolved: 05/Sep/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.2.0-rc0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Irina Yatsenko (Inactive) | Assignee: | Irina Yatsenko (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | auto-reverted | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query Integration
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | QI 2023-08-21, QI 2023-09-04, QI 2023-09-18 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 0 | ||||||||
| Description |
|
A query like ts.aggregate({$group: {_id: "$meta", m: {$min: "$control.min.value"}}}) should be optimized to take advantage of the bucket's control data instead of unpacking the buckets. When all queries against TS namespace are forced to run in classic, both ts.aggregate({$group: {_id: "$meta", m: {$min: "$value"}}}) and system.buckets.ts..aggregate({$group: {_id: "$meta", m: {$min: "$control.min.value"}}}) generate the following plan:
But if SBE lowered is allowed for TS namespaces, the query against the view only lowers the access (PROJECTION_DEFAULT + COLLSCAN) but not GROUP while the query against the backing collection is lowered fully (GROUP + COLLSCAN). This needs to be investigated because not lowering the $group properly is likely to affect performance. |
| Comments |
| Comment by Githook User [ 01/Sep/23 ] |
|
Author: {'name': 'Irina Yatsenko', 'email': 'irina.yatsenko@mongodb.com', 'username': 'IrinaYatsenko'}Message: |
| Comment by xgen-buildbaron-user [ 12/Aug/23 ] |
|
Ticket re-opened due to revert. session_jscore_passthrough began a consistent failure of jstests/core/timeseries/timeseries_index_partial.js,jstests/core/write/bulk/bulk_write_timeseries_basic.js,jstests/core/timeseries/timeseries_groupby_reorder.js,jstests/core/timeseries/bucket_unpacking_group_reorder_fixed_buckets.js |
| Comment by Githook User [ 12/Aug/23 ] |
|
Author: {'name': 'auto-revert-processor', 'email': 'dev-prod-dag@mongodb.com', 'username': ''}Message: Revert " This reverts commit 4a00fc6432e76b6b5a6d718000b3384db637c82b. |
| Comment by Githook User [ 11/Aug/23 ] |
|
Author: {'name': 'Irina Yatsenko', 'email': 'irina.yatsenko@mongodb.com', 'username': 'IrinaYatsenko'}Message: |