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

More efficient min/max updates for time-series

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: Backlog
    • Component/s: Storage
    • Labels:
      None
    • Fully Compatible
    • Execution Team 2020-12-28, Execution Team 2021-01-11

      The goal is to avoid generating $set update operations if no field in control.min or control.max is changes, and otherwise to directly generate the $set if the fields that need changes, at a level that could directly become part of an oplog entry, without using aggregation expressions.

      One idea is to have something like a data structure recursively defined that contains an unordered map, a vector, and a BSONObj. If the min/max is an object, the map will be populated. If it's an array, the vector will be populated. If it's a leaf, the BSONObj is populated. Then, when BucketCatalog::commit is called, we can either construct the complete min/max object in the insert case, or the $set fields in the update case. This way, as more inserts occur, we can iterate through the document being inserted and update the current min/max without having to reconstruct the BSONObj every time.

            Assignee:
            gregory.noma@mongodb.com Gregory Noma
            Reporter:
            geert.bosch@mongodb.com Geert Bosch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: