5.29. Query Plan Visualization #

PPEM supports visualization of query plans that can be retrieved using the EXPLAIN command. For more information about this command, refer to the official Postgres Pro documentation.

The visualization contains a tree of query plan nodes and allows you to navigate between them. Each node has a unique name and corresponds to the specified stage of query execution. Clicking on a node name displays expanded information about this node.

This section explains how to manage query plan visualizations. It includes the following instructions:

Creating a Query Plan Visualization

Before performing this instruction:

  1. Get the query plan:

    EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON)
    
  2. Copy the query plan and save it.

To create a query plan visualization:

  1. In the navigation panel, go to MonitoringVisualization.

  2. Enter parameters of the new query plan visualization (parameters marked with an asterisk are required):

    • Name.

      If you do not specify the name, it is generated automatically.

    • Query plan: The query plan that will be visualized.

    • Query: The text of the query whose plan will be visualized.

      If you specify query text, it is added to the query plan visualization.

    To create a visualization based on a query plan example, in Examples, click Blue pencil icon next to the example. In this case, parameter values of the query plan visualization are filled in automatically.

  3. Click Visualize.

Viewing a Query Plan Visualization

  1. In the navigation panel, go to MonitoringVisualization.

  2. In Saved plans, click the name of the query plan visualization.

Editing a Query Plan Visualization

  1. In the navigation panel, go to MonitoringVisualization.

  2. In Saved plans, click Blue pencil icon next to the query plan visualization.

  3. Edit query plan visualization parameters.

  4. Click Visualize.

Deleting a Query Plan Visualization

Important

Deleted query plan visualizations cannot be restored.

To delete a query plan visualization:

  1. In the navigation panel, go to MonitoringVisualization.

  2. In Saved plans, click Red bin icon next to the query plan visualization.