Query stats supplemental metrics are only recorded when the initial batch exhausts the cursor

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Critical - P2
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.supplementalMetrics becomes undefined. Restore the single large batch and the JoinOptimization section appears.

      Expected: join optimization happens once at planning, so its supplemental metrics should be recorded regardless of how the cursor is iterated. Found during review of SERVER-132802.

            Assignee:
            Daniel Segel
            Reporter:
            Aaron Schüttpelz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: