[SERVER-59678] Avoid calling sbe::PlanStage::getStats() in order to decide whether to replan Created: 31/Aug/21  Updated: 29/Oct/23  Resolved: 16/Nov/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.2.0-rc0

Type: Task Priority: Major - P3
Reporter: Anton Korshunov Assignee: Joshua Lapacik (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: QO 2021-10-18, QO 2021-11-01, QO 2021-11-15, QO 2021-11-29
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 15/Nov/21 ]

Author:

{'name': 'joshua', 'email': '80741223+jlap199@users.noreply.github.com', 'username': 'jlap199'}

Message: SERVER-59678 Avoid reconstructing PlanStageStats tree for replanning
Branch: master
https://github.com/mongodb/mongo/commit/f72a3ac7a30c06ac470d137a44eb4a9281027728

Generated at Thu Feb 08 05:47:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.