-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Querying
-
Fully Compatible
-
v5.0
-
Query Execution 2021-05-31, Query Execution 2021-06-14, Query Execution 2021-06-28
When an SBE plan is covered, it may "rehydrate" the index key into an object, which is then used in the rest of the plan. In some cases, the rest of the plan can use the "index key slots" (slots storing each component of the index key). This would save us the work of creating a temporary object.
A good example of this is how "default" projections are implemented. For example, a covered query like:
db.c.find({"a.c": 1}, {"a.c": 1, _id: 0})
Using an index {{
{a.c:1, b: 1}}} will create a temporary object for each index key. The default projection could instead use the slot storing the "a.c" component directly.
- related to
-
SERVER-57611 Simplify plans for covered projections with expressions
- Backlog
-
SERVER-57533 Avoid creating intermediate objects for covered projections with OR stage
- Closed