_shouldProduceRecordIdSlot is set to indicate if $project stage needs to produce recordId slot. If the $group stage is present the plan then it will not have recordId. Since buildProjectionDefault() is expected to be called first because it's the root (top) stage in the plan and because childReqs aren't updated by the child stage (by a $group stage) the flag _shouldProduceRecordIdSlot must be set in advance.
Investigate if its viable to update childReqs by the child stage and if its not possible then have only one traversal of the plan tree to set _shouldProduceRecordIdSlot.
- has to be done before
-
SERVER-60051 Pushdown sbe compatible stages after $group
- Closed
- is duplicated by
-
SERVER-68903 Implement SORT_SIMPLE RID optimization in SBE
- Closed