[SERVER-50905] Add RecordId type in SBE Created: 14/Sep/20  Updated: 29/Oct/23  Resolved: 09/Nov/20

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Task Priority: Major - P3
Reporter: Anton Korshunov Assignee: Nikita Lapkov (Inactive)
Resolution: Fixed Votes: 0
Labels: qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Query 2020-11-02, Query 2020-11-16
Participants:

 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.


 Comments   
Comment by Githook User [ 09/Nov/20 ]

Author:

{'name': 'Nikita Lapkov', 'email': 'nikita.lapkov@mongodb.com', 'username': 'laplab'}

Message: SERVER-50905: Add RecordId type in SBE
Branch: master
https://github.com/mongodb/mongo/commit/a4c597067a26e71859ca07de33dacde98c1747f1

Generated at Thu Feb 08 05:23:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.