[SERVER-53303] Make sort and group execution stages report number of spills to disk in explain Created: 09/Dec/20  Updated: 29/Oct/23  Resolved: 19/May/21

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

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: Denis Grebennicov
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
is documented by DOCS-14760 Investigate changes in SERVER-53303: ... Closed
Related
is related to SERVER-51026 Collect number of keys sorted per ope... Closed
is related to SERVER-48380 Expose total data size in bytes proce... Closed
is related to SERVER-49027 Extend $group explain execution stats... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query Execution 2021-05-03, Query Execution 2021-05-17, Query Execution 2021-05-31
Participants:

 Description   

Work done under SERVER-51026 recently extended the query execution systems runtime stats to track the individual number of times that a sort stage spills to disk. However, explain currently only reports whether a SORT PlanStage used disk with a boolean; if disk was used, we don't indicate the number of times that we spilled sorted data to disk. We should take advantage of the work done in SERVER-51026 and report this "spills" metric for the SORT stage.

Additionally, it would be good to report this as a runtime stat for the $sort DocumentSource. We could also make a similar extension and report the number of spills for a $group. This could build on the work done in SERVER-48380 and SERVER-49027 to add additional runtime stats for $sort and $group to agg explain output.



 Comments   
Comment by Githook User [ 19/May/21 ]

Author:

{'name': 'Denis Grebennicov', 'email': 'denis.grebennicov@Deniss-MacBook-Pro-2.local'}

Message: SERVER-53303 Make sort and group execution stages report number of spills to disk in explain
Branch: master
https://github.com/mongodb/mongo/commit/d1982e704de77f3abe0a71e770b983a6e79f6ea1

Comment by Alex Bevilacqua [ 09/Dec/20 ]

david.storch as this can be useful for diagnosing the performance of an operation I would vote for adding it to the explain output.

Comment by David Storch [ 09/Dec/20 ]

charris alex.bevilacqua this is something that occurred to me while we were working on SERVER-48380. Please let me know if it would be useful to you. I expect that it would be very straightforward to implement on our end.

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