5.4. Running and Storing SQL Commands

With a connection to a database open, type SQL commands, separated by semicolons, into the SQL Entry Area.

Figure 5-5. Entering an SQL Query

To run SQL commands, click on the blue Explain/Explain Analyze icon (or from the Statement menu, select Explain or Explain Analyze). Only the first SQL statement is explained.

Figure 5-6. Results of an SQL Query

To explain a statement other than the first, just highlight the command that you want to run and click on the blue Explain/Explain Analyze icon. If you highlight more than one SQL statement, only the first is explained.

Visual Explain also enables you to perform the following operations on existing SQL queries:

Storing

To store SQL commands for future use, click on the Save icon. You are prompted for a filename.

Loading

To load SQL command files, click on the Open icon. To run those commands, click on the blue Explain/Explain Analyze icon (or from the Statement menu, select Explain or Explain Analyze), as above.

NoteNote
 

You can view a text version of the EXPLAIN command by clicking on Window => Show EXPLAIN Output (or Window => Show EXPLAIN VERBOSE Output). You can save a text version of the contents of this window by right-clicking on it, and entering a file name when prompted.

You can see an overview of the contents of the Visual Explain output window by clicking on Window => Show Planner Overview.

You can check which non-default Planner Optimizations were used to generate the plan by choosing from the Menu Bar Window => Show Planner options.