Visual Explain displays the stages MongoDB took to execute a given query in a diagram format, with the option to show runtime statistics for each query stage. Try it today.
MongoDB explain, visualized
In previous versions of Studio 3T, it was already possible to see query plans and execution statistics through the Explain Tab, which displayed this information in tree view, like this:
Visual Explain is the evolution of the Explain Tab.
Instead of clicking through such a tree, the Visual Explain visualizes the same strategy undertaken by MongoDB in a simple-to-follow diagram.
Brief vs. Full Mode
By default, Visual Explain will show the explain diagram in brief mode without runtime statistics, like this:
It’s fast and always available for all queries, without delay.
Full mode, on the other hand, shows both the stages and runtime statistics:
It requires running the query, which might cause a delay depending on its size.
To trigger full mode, click the Run full explain button in the toolbar:
Hover over elements
You can hover over all elements in full mode to trigger additional help texts, for example:
Hovering over runtime statistics displays information like the estimated number of bytes processed by the stage:
Or the full document count (e.g. 1007 documents instead of 1.0K):
Or the time it took to execute an individual stage, or the whole query if you hover over the Result block:
Behind every MongoDB query is a query plan, and the Visual Explain displays how this plan was executed stage by stage.
View full description
To view a stage’s full description, double-click it or right-click and choose What’s This?.
Visual Explain’s full mode displays actual runtime statistics, such as:
Stage output (number of documents produced)
Shows the number of documents produced by a stage.
Tracks the number of milliseconds it took to execute a stage.
Amount of data processed
Displays the estimated amount of data processed to carry out the operation.
View the original query plan in JSON
Missing the old Explain tab? You still have the option to view the query plan as a JSON document. Click on the View original JSON document button:
View a specific stage’s query plan in JSON
The original JSON document still contains a lot of information not visible in the diagram, but they tend to be very nested and difficult to work with.
To spare the back-and-forth scrolling for those who are interested in this extra information, the Visual Explain makes it much easier to view a specific stage’s JSON fragment:
- Right-click on a stage block.
- Click on view original JSON fragment.
- This will display only that specific stage’s JSON fragment, instead of the full query plan.
List of supported query stages
creates an overall query plan based on the winning plan from each clause.
search process itself.
to the application, and is displayed as "just some stage".