[SERVER-79621] Consider adding a way to figure out the number of measurements in a bucket Created: 02/Aug/23  Updated: 29/Oct/23  Resolved: 04/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: Yoon Soo Kim Assignee: Yoon Soo Kim
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-79773 Complete TODO listed in SERVER-79621 Closed
Assigned Teams:
Query Integration
Backwards Compatibility: Fully Compatible
Sprint: QI 2023-08-21
Participants:

 Description   

Quoting Irina's comment here:
I believe that we will have to always include _id field even if it isn't explicitly used in a query because otherwise we won't be able to identify the gaps at the tail of a column (for queries like [{$match: {foo: {$ne: 42}}, {$count: "n"]), that is we need a guaranteed "dense" field among the paths the stage is deblocking from. I mean, the code here isn't wrong but we should probably document in the stage's header that it requires a dense path for correctness (I've also added a similar comment to the design doc).

Yoonsoo's reply:
Thanks for pointing this out! This is definitely concerning. Even _id field can be missing like after db.ts.updateMany({}, {$unset: {_id: ""}}). But the time field must always exist. Probably we can always include the time field instead. I think it would be a better option to add a VM builtin function which returns the number of rows in a bucket.



 Comments   
Comment by Githook User [ 07/Aug/23 ]

Author:

{'name': 'Yoonsoo Kim', 'email': 'yoonsoo.kim@mongodb.com', 'username': 'yun-soo'}

Message: SERVER-79621 Have ValueBlock::extract() return dense output
Branch: minh.luu-no_compile_sys-perf
https://github.com/mongodb/mongo/commit/c457aea7d6eac9ab87eff0cda7c02ec77fa1e220

Comment by Githook User [ 04/Aug/23 ]

Author:

{'name': 'Yoonsoo Kim', 'email': 'yoonsoo.kim@mongodb.com', 'username': 'yun-soo'}

Message: SERVER-79621 Have ValueBlock::extract() return dense output
Branch: master
https://github.com/mongodb/mongo/commit/c457aea7d6eac9ab87eff0cda7c02ec77fa1e220

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