-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
It is common to update the additional storage bytes using the previous and current value of spilling stats similar to the code below
auto storageSizeBeforeSpillUpdate = spillingStats.getSpilledDataStorageSize(); spillingStats.updateSpillingStats( 1 /* spills */, spilledBytes, spilledRecords, _rs->storageSize(_opCtx)); auto storageSizeAfterSpillUpdate = spillingStats.getSpilledDataStorageSize(); counters.incrementPerSpilling(1 /* spills */, spilledBytes, spilledRecords, storageSizeAfterSpillUpdate - storageSizeBeforeSpillUpdate); }
Instead of tracking the additional bytes by themselves we should incorporate them in the updateSpillingStats.