[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:
Depends
Related
related to MONGOID-4030 Typed array as field type Backlog
is related to SERVER-8716 Various update() operators for Binary... Backlog
is related to SERVER-9342 BSON storing 32 bit floats Open
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.

  • Add array of new values to end
  • Pull n values from end, returns array
  • add array of new values to front
  • pull n values from front, returns array

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.

  • Push/Pull - simultaneous push onto one side and pop from the other. Takes array of values to add. Returns elements popped.

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.

Generated at Thu Feb 08 03:20:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.