Details
-
Task
-
Resolution: Unresolved
-
Major - P3
-
None
-
None
-
None
-
None
-
Query Execution
Description
In the SBE plans we've recently started generating for time series, if there is $project that does `buildProjectionDefault()` it would require the child stage to produce the kResult slot. It means the plan would look like:
db.ts.explain().aggregate([{$match: {c: 42}},{$project: {_id: 0, b: 1}}]).queryPlanner.winningPlan.slotBasedPlan.stages // "b" is meta field and "c" is a measurement field
|
|
|
[3] project [s8 = makeBsonObj(MakeObjSpec(["b"], Closed, ReturnNothing), s7)]
|
[2] mkbson s7 [c = s6, b = s4] true false
|
[2] filter {traverseF(s6, lambda(l101.0) { ((move(l101.0) == 42L) ?: false) }, false)}
|
[2] block_to_row blocks[s5] row[s6]
|
[2] ts_bucket_to_cellblock s2 pathReqs[s5 = Get(c)/Id] s4 = meta
|
...
|
Because a kResult slot is requested, we finish bucket unpacking with a materializing mkbson stage, only to pass it to the project stage which will rematerialize a subset of the fields.