[SERVER-9380] Add single-type arrays Created: 17/Apr/13 Updated: 06/Dec/22 |
|
| Status: | Open |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | features we're not sure of |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Andrew Emil (Inactive) | Assignee: | Backlog - Query Execution |
| Resolution: | Unresolved | Votes: | 4 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Assigned Teams: |
Query Execution
|
||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
Type information in BSON carries a storage overhead with it. By creating an array that has a single datatype inside of it, the repeated type information can be removed, allowing for much more efficient storage data that has a single type. Note that these arrays should have all of the same functionality and operators as normal arrays. |
| Comments |
| Comment by Kevin J. Rice [ 04/Sep/14 ] |
|
Operations required on the array types are as follows. First, we decide that front is rightmost and back is leftmost. it can work the other way, but for this ticket, presume it is this way. Operations required here are to enable this single-type array to be a queue or a stack.
All the above operations should take as input an array of new values, and return an array of values CIRCULAR QUEUE: There's another use-case where it's a limited-size queue, keeping the most recent elements. This seems widely useful for people that only need to keep the n most recent values.
OPTIONAL: INSERT/DELETE RANDOM ELEMENTS Another probably much frequent use-case is for acting on subsets of the data, passing in lists of element numbers to pop, or lists of element numbers to insert at specific locations. OPTIONAL: STORING NULL VALUES Single-data type arrays of numbers are useful for many people. There's an additional use for them, which is storing time-series data. In this case, it's also VERY useful to store NULL values specially. This denotes that we have no data for that time slot. It would be very nice to have this as a special value in the array, but it's not required, as we can indicate this with some special floating-point value like max-float or max-int. |