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

Implement algorithm to determine scale factor

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Execution Team 2021-08-09, Execution Team 2021-08-23

      Scale factor is determined at high level in the BSON type 7 binary. When an encoder is appending doubles that need to compress we will start with scale factor 0 when starting a new Simple-8b block.

      Every double that is appended need their minimal scale factor needed to be able to represent the double exactly as an integer. 

      When a double is appended that needs a larger scale factor than previous doubles the encoder need to determine what can compress the most values between:

      1. Finalize current Simple-8b block and start a new block for the value that needed a larger scale factor.
      2. Re-scale previous values to the new (higher) scale factor and check if they still fit within a single Simple-8b block together with the new value.

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

              Created:
              Updated:
              Resolved: