[SERVER-58580] Implement sub-object interleaving Created: 15/Jul/21  Updated: 29/Oct/23  Resolved: 20/Oct/21

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

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

Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2021-09-20, Execution Team 2021-10-04, Execution Team 2021-10-18, Execution Team 2021-11-01
Participants:

 Description   

Implement sub-object interleaving to compress BSON Documents.

Determine a depth-first ordering of scalar field within a parent document. The binary stream should be interleaved with operation bytes belonging to separate fields based on this order.

When a sub-field is out of values in current operation it will continue at next operation currently not used by any sub-stream. The ordering guarantees that this will belong to this sub-field.

Interleaving ends when a EOO literal is read.

Any change to the hierarchy of the parent BSON Document requires the interleaving to end. But it will re-start if a new BSON Document literal is written to the stream.



 Comments   
Comment by Githook User [ 13/Oct/21 ]

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: SERVER-58580 Decoding support for compressed subobjects in BSONColumn

BSONColumn has been refactored to put the decoding state into a DecodingState class.

A new control byte in the data stream has been added for entering "interleaved" mode where sub-elements are compressed separately.

One DecodingState is set up for each scalar element in the reference interleaved Object. When decompressing we extract one value from each state to build the full BSONObj to return. We always scan in a fixed order.

Control bytes in the binary stream corresponds to the DecodingState that needs to read the next value.
Branch: master
https://github.com/mongodb/mongo/commit/d9d70aaf89337e3e6a263abcc271d159fe857985

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