Explain Plan
You can visualize a query or a JSON Explain Plan as a tree structure. You can click each executor in the tree structure to view its associated details. You can zoom in or out of the visualization.
You can provide a query or the JSON explain plan and generate the visualization.
Viewing the explain plan of a query
- Go to MemSQL → Explain Plan.
- In the Source Type menu, select Query.
- In the Database Name menu, select the database on which you want to run the query.
- Type or paste your query into the text box.
- Click the Run button
and select Visualize Plan.
- Click an executor in the tree structure to view more information about it.
The following image shows a sample of the visualization.
The right pane displays information about the Project executor.
Visualizing a JSON Explain Plan
To visualize a JSON explain plan, do the following.
- Go to MemSQL → Explain Plan.
- In the Source Type menu, select JSON Explain Plan.
- Type or paste the JSON explain plan into the text box.
- Click the Run button
and select Visualize Plan.
- Click an executor in the tree structure to view more information about it.
The following image shows a sample of the visualization for a JSON Explain plan. The right pane displays information about the Repartition executor.
Profiling a Query
Profiling a query enables you to view runtime details of a query such as the number of rules that will be executed, or the time that the query will take to run. You can view both the estimates as well as the actual values.
To profile a query:
- Go to MemSQL → Explain Plan.
- In the Source Type menu, select Query.
- In the Database Name menu, select the database on which you want to run the query.
- Type or paste your query into the text box.
- Click the Run button
and select Profile. The profile of the query is displayed. Click an executor to view its details. Click the Reset button to return to the overall view of the explain plan.