[SERVER-54189] [SBE] Support queries like "find({_id:1},{a:1})" and "find({_id:1}).returnKey()" Created: 01/Feb/21  Updated: 29/Oct/23  Resolved: 05/Feb/21

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

Type: Task Priority: Major - P3
Reporter: Drew Paroski Assignee: Drew Paroski
Resolution: Fixed Votes: 0
Labels: qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-54471 Remove $_internalInhibitOptimization ... Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

When SBE is enabled, I noticed that some simple queries such as "find({_id:1},{a:1})" and "find({_id:1}).returnKey()" fail with an error message that says "IDHack plan is not supported by SBE yet".

Looking at the current state of the SBE stage builder code, it seems like we have all the infrastructure necessary to support the two queries mentioned above.

The goal of this task is to (1) figure out what changes should be made to the SBE stage builder so that SBE can run the find() queries below and (2) to implement said changes:

> db.c.drop()
> db.c.insert({_id: 1, a: 2})
> db.c.createIndex({a: 1})
 
> db.c.find({_id: 1}, {a: 1})
 
> db.c.find({_id: 1}).returnKey()



 Comments   
Comment by Githook User [ 05/Feb/21 ]

Author:

{'name': 'Drew Paroski', 'email': 'drew.paroski@mongodb.com', 'username': 'paroski'}

Message: SERVER-54189 [SBE] Support queries like "find({_id:1},

{a:1}

)" and "find({_id:1}).returnKey()"
Branch: master
https://github.com/mongodb/mongo/commit/915296e7f09ee9934a5d6794bc70f3c78104f81e

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