SERVER-134077ClosedFixed
Query stats supplemental metrics are only recorded when the initial batch exhausts the cursor
Supplemental query stats metrics (e.g. the JoinOptimization section) only appear in the recorded query stats entry when the query's initial batch exhausts the cursor. With the default 101-doc batch plus getMores, the entry has no {{supplementalMetrics}} at all, even though the query ran join optimization. Repro: in {{{}jstests/noPassthrough/query/joins/query_stats_join_optimization_metrics.js{}}}, remove the {{{batchSize: 100000}}} option from any aggregate, {{stats[0].metrics.supplementalMe