|
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:
- Add a new RecordId type to sbe::value::TypeTags enum.
- Create a isRecordId() helper function.
- Create a new isRecordId() VM instruction.
- Update compareValue(), numericCast(), numericConvLossless(), tagToType(), writeTagToStream(), writeValueToStream(), hashValue() to handle the new type.
- Update PlanExecutorSBE here, here and here.
- Update index and collection scan stages to store the RecordId using the new type (note this check as well).
- Modify generic index scan builder here and here.
|