Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-90962

Implement optimized BSONColumn first, last for interleaved mode

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution

      first and last expressions in BSONColumn should return first and last non-skipped value respectively which means we need to do some special handling for interleaved mode.

      If all streams in interleaved mode starts or ends with all skip then we cannot just return this value as it is defined as a skip.

      For first, we need to continue parsing the stream until one of our substreams contain a non-skipped value.

      For last, we can calculate the last value of the stream using sum()/prefixSum() but we also need to check if the last value in each substream is skip. Any substream ending with a skip must be treated as skip. Remaining is the last edge case of all values in all substreams containing skips, then there is no last value and we need to make sure we did not materialize any.

            Assignee:
            Unassigned Unassigned
            Reporter:
            henrik.edin@mongodb.com Henrik Edin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: