-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Query Execution
-
None
-
Query Execution
-
Fully Compatible
-
QE 2026-02-16
-
None
-
None
-
None
-
None
-
None
-
None
-
None
When building the keyString to perform an index scan, we build a Ordering object incapsulating the directions of each column in the index definition. The interface forĀ
Ordering::make expects a BSONObj where each field is either 1 or -1, i.e. it accepts the BSON holding the index definition. In the SBE byte code we have at disposal an integer whose bits are either 0 or 1 depending on whether the direction is ascending or descending, so we allocate a BSONObjBuilder to create a BSON object that look like an index definition (using empty field names, btw).
This allocates and deallocates a buffer on the heap, resulting in a trace in a profiler run, that we could remove by adding a version of Ordering::make more friendly toward C++ (a vector of boolean?)