-
Type: Task
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Integration
$count query is rewritten as $group+$project over $_internalUnpackBucket stage so it is an include bucket spec but it might have no fields listed if there is no filter prior to counting. Ideally, we should support lowering such queries to SBE but if producing the right count of "empty documents" from the container stages proves to be tricky we should ensure the perf doesn't regress (either because it's OK to lower the prefix of the pipeline or because we block the lowering completely)