[go: up one dir, main page]

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 and visualize query plans. It includes the following instructions:

Creating a Query Plan

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:

  1. In the navigation panel, go to MonitoringVisualization.

  2. (Optional) To create a query plan based on an example, in the left part of the page, select Examples and click the name of the example.

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

    • Name.

    • Query plan.

    • Query: The text of the query.

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

    • Instance and Database: The instance and database where the query is executed and with which the query plan will be associated.

    • Description.

    • Private visualization: Specifies whether the query plan can be shared with other users.

      If you enable this checkbox, the query plan is available only to you.

  4. (Optional) To visualize the query plan, click Visualize.

  5. Click Save.

Visualizing a Query Plan

  1. In the navigation panel, go to MonitoringVisualization.

  2. In the left part of the page, perform one of the following actions:

    • On Saved visualizations, click the name of the query plan.

    • Select Examples and click the name of the query plan example.

  3. In the bottom-right corner of the page, click Visualize.

Editing a Query Plan

  1. In the navigation panel, go to MonitoringVisualization.

  2. In Saved visualizations, click the name of the query plan.

  3. Edit query plan parameters.

  4. Click Save.

  5. Perform one of the following actions:

    • To save the edited query plan, click Save.

    • To save the edited query plan as a new one, enter the name of the new query plan and click Create.

Sharing a Query Plan With Other Users

You can share a query plan with other users so that they can visualize it.

To share a query plan with other users:

  1. In the navigation panel, go to MonitoringVisualization.

  2. In Saved plans, click Share next to the query plan.

The query plan link will be saved to your clipboard. You can share this link with other users. When a user follows the link, the query plan is saved to their web application.

Deleting a Query Plan

Important

  • Deleted query plans cannot be restored.

  • Users cannot visualize shared query plans after deletion.

To delete a query plan:

  1. In the navigation panel, go to MonitoringVisualization.

  2. In Saved plans, click Delete plan from list next to the query plan.

  3. Click Delete.