[SERVER-85684] SBE $lookup construct incomplete index key Created: 24/Jan/24  Updated: 30/Jan/24

Status: Open
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Zixuan Zhuang Assignee: Zixuan Zhuang
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-85577 Missing fields in KeyString cause inc... Closed
Operating System: ALL
Participants:

 Description   

For compound index, when the first field is used in $lookup, SBE only generates index key with a single field instead of all fields

{$lookup: {from: coll.getName(), localField: 'a', foreignField: 'a', as: 'array'} 

The generated keys are {a: 1}, {a: 1} instead of {a: 1, b: MinKey}, {a: 1, b: MaxKey}

 

https://github.com/10gen/mongo/blob/b5f58d8cc3853c3bdecba44bf3fdf419fa200cf8/src/mongo/db/query/sbe_stage_builder_lookup.cpp#L885


Generated at Thu Feb 08 06:58:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.