Factor QE cursor/batch execution helpers out of run_aggregate.cpp

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • QE 2026-06-22, QE 2026-07-06
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      run_aggregate.cpp is 1,652 lines and mixes QO-owned pipeline orchestration with QE-owned cursor and batch execution machinery. Extract the QE-owned helpers into a new run_aggregate_exec.cpp / run_aggregate_exec.h pair, and assign the new files to 10gen/query-execution in OWNERS.yml.

      Functions to extract: registerCursor, collectQueryStats, getFirstBatch, executeSingleExecUntilFirstBatch, executeUntilFirstBatch (and optionally handleMultipleCursorsForExchange).

      The remaining pipeline orchestration, view resolution, and explain logic stays in run_aggregate.cpp under 10gen/query-optimization.

      As a stretch goal (or follow-up), identify QI-owned functions still remaining in run_aggregate.cpp and either move them into a run_aggregate_qi.cpp in the same PR or file a follow-up.

      Likely candidates include computeShapeAndRegisterQueryStats (query stats/observability, QI), and createMongotMetadataPipelineIfNeeded / getDocResultsAndMetadataStage / addMetadataCursorExecutor (search extensions, QI-search).

            Assignee:
            Mihai Andrei
            Reporter:
            Mihai Andrei
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: