[SERVER-54745] Avoid creating intermediate object in covered SBE plans Created: 24/Feb/21  Updated: 29/Oct/23  Resolved: 11/Jun/21

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 5.0.0-rc2

Type: Improvement Priority: Major - P3
Reporter: Ian Boros Assignee: Nikita Lapkov (Inactive)
Resolution: Fixed Votes: 0
Labels: post-rc0, sbe-post-rc0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
related to SERVER-57611 Simplify plans for covered projection... Backlog
related to SERVER-57533 Avoid creating intermediate objects f... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.0
Sprint: Query Execution 2021-05-31, Query Execution 2021-06-14, Query Execution 2021-06-28
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 14/Jun/21 ]

Author:

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

Message: SERVER-54745 Simplify covered projection plans in SBE

(cherry picked from commit 13d2be97d1ba504057ee2cddd67c13e5bce37aa5)
Branch: v5.0
https://github.com/mongodb/mongo/commit/6907e2428492cb265f03c80158a8217ecc2f4163

Comment by Githook User [ 11/Jun/21 ]

Author:

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

Message: SERVER-54745 Simplify covered projection plans in SBE
Branch: master
https://github.com/mongodb/mongo/commit/13d2be97d1ba504057ee2cddd67c13e5bce37aa5

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