Thread SimpleMemoryUsageTracker through MatchStage

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      MatchStage will create a SimpleMemoryUsageTracker using createChunkedSimpleMemoryUsageTrackerForStage. No per-stage limit is configured so the default INT_MAX is used. The tracker is threaded down through MatchProcessor::process() --> matchesBSON() --> MatchExpressionEvaluator, where it is stored as a _tracker member variable. This avoids passing the tracker through every visit() override since only visit(const ExprMatchExpression*) uses it, because that is the only path that evaluates arbitrary expressions. The input document size is added to the tracker so that expression evaluation is accounted for in the context of the document being matched. Plain predicate matching does not allocate significant memory and requires no tracking. The flags gFeatureFlagExpressionMemoryTracking and gFeatureFlagMemoryTracking must be checked before passing the tracker.

            Assignee:
            Projjal Chanda
            Reporter:
            Projjal Chanda
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: