-
Notifications
You must be signed in to change notification settings - Fork 2
Using PostgreSQL Explain Graph
Need help? Have a suggestion? Navigate to Issues.
Read about the latest updates.
Dive into Advanced Features of PostgreSQL Explain Graph.
Click images below to see them full-size.
Tested for all versions of PostgreSQL from 9.3 - 12.1. Free... for now.
![](../raw/master/images/ss-add-plan-button.png)
Enter your server hostname, database, userid, password, etc. and query.
Your query MUST include explain
and format json
. PostgreSQL Explain Graph will not be able to show the plan without these parameters.
Finally, click Execute and Show Plan Graph.
If you've already generated a JSON plan (from psql, your database application, or wherever it is), plan, copy it and paste it into the bottom field, then click Show JSON Plan Graph.
![](../raw/master/images/ss-plan-source.png)
Wait for your PostgreSQL database to retrieve the plan details.
Once the JSON plan is retrieved, it will be displayed as a directed graph. It will also be stored in the JSON plan field, so you can study it in the future or send it to others for analysis without having to run the query again.
If you paste only a JSON explain plan, then click Show JSON Plan Graph
. It should appear quickly.
Click an operator box to see its properties.
OPERATOR PROPERTIES:
![](../raw/master/images/sr-plan-graph-operators-gif.gif)
Use the toolbar to view actual or estimated rows or data mass, and show the ratios between actual and estimated values. Red and yellow backgrounds indicate largest and second largest percentages. On each arrow, boldface text indicates actual values, and normal text indicates estimates. If there are no numbers, it means there are no values, or you are viewing a ratio.
LINE THICKNESS BY TOOLBAR and PERCENTAGE BY TOOLBAR:
Use the time slider and cost slider to get a sense of how long each operation takes in relation to other operations, as well as the entire query.
If an operator has a little box in the upper-right corner, that means the operation is using workers. Click the little box to toggle worker information.
After you generate two or more explain plan graphs, you can compare their costs and duration. Highlight all plans you want to compare, then click the Compare Plans
tab.