Visual Explain uses menus, icons, and graphical displays to make it easy for you to connect to a database and visualize the query planner output.
Along the top of the main program window is the Menu Bar. The Menu Bar enables access to SQL and query plan archiving, planner options, preferences and window management dialogs. Below the Menu Bar is the Toolbar. The Toolbar enables you to save, load, and run SQL statements, change the display orientation, and view the nickname of the database to which you are connected.
Below the Toolbar are two panes. On the left is the View Pane, which displays the graphical representation of the query plan. To the right of the View Pane is the Detail Pane, which displays the name of the highlighted node, its characteristics, and performance cost.
Below the View and Detail Panes is the SQL Entry Area, which is where you enter the SQL query you would like explained.
Below the SQL Entry Area is the Status Bar. The Status Bar displays the state of the current database connection.
The Menu Bar allows access to SQL and query plan archiving, planner options, preferences, and window management dialogs, among other things.
The Menu Bar has the following menus:
File contains the following items:
New clears the SQL Entry Area so that you can type in new SQL commands. You can also save any commands currently in that area.
Open presents a dialog where you specify the name of an SQL command (.sql) file or a saved Plan (.pln) file that you want to open. Typically, this is a file that you have created and saved with Visual Explain.
Save writes the contents of the SQL Entry Area to the current .sql file name, if you have opened a .sql file, or to a .pln file, if you have opened a saved Plan file. (If there is no current file, you are prompted for a file name and path, as in Save As, below.)
Save As writes the contents of the SQL Entry Area to a new .sql file name and path that you specify, if you do not have a plan displayed. If you do have a plan, you can save as a .sql file or as a .pln file by selecting the File Type on the File Chooser dialog.
Exit closes Visual Explain.
Edit contains the following items:
Cut removes the selected text from the SQL Entry Area and places it in a clipboard.
Copy places the selected text from the SQL Entry Area in a clipboard.
Paste places the contents of the clipboard into the SQL Entry Area at the cursor location.
Planner Options enables you to change the connection's planner variables so that you can see what other plans the planner would generate.
Databases enables you to configure connections to databases.
Preferences enables you to configure whether clicking the Explain/Explain Analyze icon invokes EXPLAIN or EXPLAIN ANALYZE, whether Tool Tips appear, and the way icons display, among other things.
Statement contains launchers that run either EXPLAIN and EXPLAIN ANALYZE on the selected text in the SQL Entry Area. (This text is typically an optimizable SQL command such as SELECT.) You can use this menu item to run whichever function is not invoked by the Toolbar's Explain/Explain Analyze icon. (The function that is invoked by the Toolbar's Explain/Explain Analyze icon is configured with Edit => Preferences => General => Toolbar Button.)
View controls the appearance of the display area. You can Zoom In, Zoom Out, or reset the display to its Actual Size. You can also have the display Fit In Window or Fit Width, change its orientation, or Refresh.
In addition to the main window, you can also display overview windows that shows the entire plan tree, the text artifact produced by the backend's EXPLAIN or EXPLAIN ANALYZE commands, and the planner options used when obtaining the plan.
Window controls whether the display area shows the following windows:
Displays an overview of the contents of the Visual Explain View Pane.
The value of planner-related variables set to non-default values used to obtain the currently displayed plan.
Displays a text version of the contents of the Visual Explain View Pane.
Displays the verbose text version of the contents of the Visual Explain View Pane.
Help contains information about Visual Explain in the About menu item. It also gives access to the appropriate sections of this manual in HTML.
Some Menu Bar functions can be activated from the keyboard.
The Toolbar enables you to save, load, and run SQL statements, change the orientation of the displayed query output, zoom in or out, and view the nickname of the database to which you are connected.
The Toolbar contains buttons that perform the following actions:
|New SQL file (clear SQL Entry Area and the current plan).|
|Open SQL or Plan file.|
|Save the contents of the SQL Entry Area or the current plan.|
|Run the SQL command in the SQL Entry Area. This is referred to as the Explain/Explain Analyze icon.|
|Stop the current query.|
|Show/Hide the Plan Overview window.|
|Change the tree orientation of the View Pane.|
|Zoom in, zoom out, specify zoom factor for the View Pane.|
|Database to which Visual Explain is connected.|
Table 4-1. Visual Explain Toolbar Buttons
The View Pane (left pane) displays the graphical representation of the query plan for the execution of your SQL query. The Detail Pane (right pane) is a table that displays the name of the highlighted plan node, its characteristics, and performance cost.
You can move the visible portion of the View Pane by using the scroll bars
or by putting the focus in the View Pane, holding down
The View Pane can contain the following node icons:
|Aggregate||Produce one value from multiple input rows.|
|Append||Combine rows from multiple input nodes.|
|Group||Combine input rows into groups.|
|Hash||Select rows using a hash.|
|Initplan||Process an un-related sub-query.|
|Join||Combine rows from two input nodes.|
|Limit||Select a certain number of rows.|
|Materialize||Create a temporary table.|
|Result||Generate a row or rows from an expression (with no table reference), or check a constant qualification.|
|Scan||Scan a relation for certain rows.|
|SetOp||Perform a set operation.|
|Sort||Place input rows in some order.|
|SubPlan||Process a sub-query.|
|Unique||Discard all duplicate rows.|
Table 4-2. Visual Explain Icons
The SQL Entry Area is where you type your SQL queries. Use the menus or the Toolbar buttons to execute or save them.