Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-59678

Avoid calling sbe::PlanStage::getStats() in order to decide whether to replan

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • QO 2021-10-18, QO 2021-11-01, QO 2021-11-15, QO 2021-11-29

      This is an expensive call which reconstructs a full PlanStats tree. However, we only need a single metric from this tree which represents a total number of storage reads performed during PlanStage tree execution and computed with calculateNumberOfReads().

      However, it seems there is a cheaper way to get this number. We can use accumulate() to populate a PlanSummaryStats instance off the PlanStage's common stats without constructing a PlanStats tree. Then we can sum up totalKeysExamined and totalDocsExamined to get the total number of storage reads.

            Assignee:
            joshua.lapacik@mongodb.com Joshua Lapacik (Inactive)
            Reporter:
            anton.korshunov@mongodb.com Anton Korshunov
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: