[SERVER-56193] Write a JS script to translate "executionStats" section of explain from SBE into classic format Created: 20/Apr/21 Updated: 29/Oct/23 Resolved: 14/Jul/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.1.0-rc0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Anton Korshunov | Assignee: | David Storch |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | sbe-post-v1, sbe-rollout | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Sprint: | Query Execution 2021-05-03, Query Execution 2021-05-17, Query Execution 2021-05-31, Query Execution 2021-06-14, Query Execution 2021-06-28, Query Execution 2021-07-12, Query Execution 2021-07-26 | ||||
| Participants: | |||||
| Description |
|
The "executionStats" section of the explain output in SBE is drastically different from the classic engine. To help in transitioning from the old to the new format, we need a tool which would allow to convert the "executionStats" section from SBE into classic format. The tool would work off the "queryPlanner" section using it as a backbone for the translated "executionStats" section. For each QSN from the "queryPlanner" section we'd need to map it to an SBE sub-tree in the "executionStats" section based on the nodeId, then collect cumulative execution stats for this sub-tree and attach it to a "stage" element in the "executionStats" tree created from the corresponding QSN. |
| Comments |
| Comment by Vivian Ge (Inactive) [ 06/Oct/21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you! | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 14/Jul/21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'David Storch', 'email': 'david.storch@mongodb.com', 'username': 'dstorch'}Message: This experimental shell helper can be used to present | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by David Storch [ 29/Apr/21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
A few conclusions from a meeting about this work today with myself, christopher.harris, and anton.korshunov. CC alex.bevilacqua.
Let me know if there are any other points from the meeting that I missed! | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by David Storch [ 28/Apr/21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi christopher.harris, alex.bevilacqua, and anton.korshunov! I've produced a draft of a JS script that I would like your feedback on. It is attached as "massage_sbe_explain.js". I also pushed it to a branch on my fork of mongodb/mongo here: https://github.com/dstorch/mongo/tree/SERVER-56193. Here's a quick example of what it looks like. I ran the following, which uses the shell to load my script and then runs the massageSbeExplain() function provided by the script:
The output looks like this:
There are three candidate plans with associated plan numbers 0, 1, and 2. The plan with id 0 is the winning plan – the script always puts the winning plan first. Each of the nodes in the winning plan has been augmented with a field called "execStats". These stats are derived by the script using the full-blown SBE output. The winning plan and the rejected plans additionally are augmented to have "trialExecStats" which are derived from the "allPlansExecution" output of the original explain. The output also prominently features the plan summary stats in case you are not interested in the detailed description of the plan. For additional documentation and a more complete description of the output generated by the script, see the this comment. This work is definitely not complete, and there are several open questions and TODOs:
This is a longer discussion, so it's probably best to find a time to meet, but let me know if you have thoughts in the meantime. |