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

  1. Go to MemSQLExplain Plan.
  2. In the Source Type menu, select Query.
  3. In the Database Name menu, select the database on which you want to run the query.
  4. Type or paste your query into the text box.
  5. Click the Run button Run and select Visualize Plan.
  6. Click an executor in the tree structure to view more information about it.

The following image shows a sample of the visualization.

Explain Plan

The right pane displays information about the Project executor.

Visualizing a JSON Explain Plan

To visualize a JSON explain plan, do the following.

  1. Go to MemSQLExplain Plan.
  2. In the Source Type menu, select JSON Explain Plan.
  3. Type or paste the JSON explain plan into the text box.
  4. Click the Run button Run and select Visualize Plan.
  5. 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.

Visualize Plan

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:

  1. Go to MemSQL → Explain Plan.
  2. In the Source Type menu, select Query.
  3. In the Database Name menu, select the database on which you want to run the query.
  4. Type or paste your query into the text box.
  5. Click the Run button Run 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.