Thread SimpleMemoryUsageTracker in SBE stages

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      ProjectStage, FilterStage and LoopJoinStage evaluate expressions in SBE. All will create a SimpleMemoryUsageTracker using createChunkedSimpleMemoryUsageTrackerForSBE and pass it to ByteCode via the setTracker() method (SERVER-127228) in prepare(). This enables VM stack-level tracking and built-in function instrumentation during expression evaluation.

      ProjectStage additionally needs to track the cumulative memory of the values returned by expressions. This is done automatically by the ByteCode since it does not decrease the memory usage for the result. 

      All stages should track the memory used by their input and, since they are all streaming, they should reset their memory usage before returning their output.

      The stages should check both flags gFeatureFlagQueryMemoryTracking and gFeatureFlagExpressionMemoryTracking and set the tracker only when both are set.

            Assignee:
            Unassigned
            Reporter:
            Foteini Alvanaki
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: