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

Refactor numeric type conversion out of BSON

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Sprint:
      Query 2020-11-30, Query 2020-12-14, Query 2020-12-28, Query 2021-01-11, Query 2021-01-25, Query Optimization 2021-02-22, Query Optimization 2021-03-08, Query Optimization 2021-03-22, Query Optimization 2021-04-05, Query Optimization 2021-04-19, Query Optimization 2021-05-03, Query Optimization 2021-05-17

      Description

      The existing query parsing system uses member functions on the BSON objects/elements representing the query to perform numeric type conversion when necessary as it builds the MatchExpression tree or pipeline.

      With the new CST + bison-based parser, we ideally remove the need for BSON at the initial parse, but often need to do type conversion afterwords (like during validation and translation). This means that to ensure we're doing conversions identically to the old code, we need to recreate temporary BSONObjs, which is annoying and has allocation overhead .

      When we get a chance, we should refactor the type-conversion operators on the BSON currently used in parsing to make them independent of the BSON (possibly as a library of free functions, allowing them to be used independently of BSON and to have the existing BSON methods delegate to them).

      cc Jacob Evans David Percy

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jacob.evans Jacob Evans
              Reporter:
              george.wangensteen George Wangensteen
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: