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

Add RecordId type in SBE

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.9.0
    • None
    • Querying
    • Fully Compatible
    • Query 2020-11-02, Query 2020-11-16

    Description

      Currently we use NumberInt64 as an SBE type when placing a RecordId into a slot. This practice is quite fragile. For example, if we need to filter on a RecordId type, any 64-bits numeric value can be interpreted as a valid recordId. Moreover, RecordId's can participate in arithmetic operations, which doesn't make a lot of sense too. Also, if the underlaying storage type for the RecordId is changed from a 64-bits integer to something else, a big layer of the SBE engine will have to be modified to take it into account. Should we have a dedicated RecordId type in SBE with its own semantics, such a change would be much more manageable.

      As part of this ticket we will need to:

      1. Add a new RecordId type to sbe::value::TypeTags enum.
      2. Create a isRecordId() helper function.
      3. Create a new isRecordId() VM instruction.
      4. Update compareValue(), numericCast(), numericConvLossless(), tagToType(), writeTagToStream(), writeValueToStream(), hashValue() to handle the new type.
      5. Update PlanExecutorSBE here, here and here.
      6. Update index and collection scan stages to store the RecordId using the new type (note this check as well).
      7. Modify generic index scan builder here and here.

      Attachments

        Activity

          People

            nikita.lapkov@mongodb.com Nikita Lapkov (Inactive)
            anton.korshunov@mongodb.com Anton Korshunov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: