Configuring Visual Explain

This section describes how you configure Visual Explain.

Note

If your database server has the rh-postgresql-test package installed and the regression tests have been run, you will be able to perform the Visual Explain tutorials that appear later in this manual. (If these have not been done, you might want to install the rh-postgresql-test package and run the regression tests now.) Refer to the Red Hat Database Getting Started / Installation Guide for details.)

Configuring Visual Explain's Operation

  1. On the Edit menu, click on Configuration. The Configure window appears.

    If you want, change the settings for:

    • ToolbarButton

      The toolbar button that runs the explain command can be set to run either an EXPLAIN or an EXPLAIN ANALYZE command. No matter which command you associate with the toolbar button, both commands are available from the Statement menu.

      "ANALYZE" is an EXPLAIN option that is available starting with PostgreSQL version 7.2. In addition to the usual EXPLAIN output, you will see:

      • The running time, including the total running time

      • The number of rows returned

      • The number of loops performed.

      Note

      These extra attributes may not be shown for some nodes. This is normal behavior.

    • Display Tool Tips

      "Tool Tips" are the explanatory labels that appear when you rest the mouse cursor over a button.

  2. Click on the Display tab. The Display settings appear.

    If you want, you can change the following settings:

    • Anti-Alias Trees

      Anti-aliased graphics are more attractive, but take a little longer to display.

    • Use Large Icons

      This setting controls the size of the icons used to display the results of the SQL query. The large icons are 48x48; the small icons are 32x32.

      This setting is independent of the magnification that you can apply by using the magnification icons or drop-down magnification menu.

  3. Click on the Databases tab. The Databases settings appear.

    If you want, you can enable Save Database Passwords.

    Visual Explain stores database connection information that can include a database password. However, if you save your password, that password is saved in the Visual Explain configuration file in plain text.

    How you configure a connection to a database is described in the next section.

Configuring a Connection to a Database

  1. If the Databases tab of the Configure window is not currently being displayed, on the Edit menu, click on Configuration, then click on the Databases tab.

  2. On the Databases tab, click on New. The New Database window appears.

  3. Fill in the fields on the New Database window:

    • Nickname is a required name that identifies a database connection. This name is used only in Visual Explain; it is not communicated elsewhere.

    • Database is the name of the database to connect to.

    • Host is the name of the host that is running the database. The default is localhost; if the database is on a different host, you must enter its name or IP address here.

    • Port is the port number to connect to on Host. You can use the default (5342) or specify a different port.

    • User Name is the database user name to connect as. Remember that the name you use may affect the portions of the database that you can see. This is a required field.

    • Password is the database password for the above user name. If you enter a password here, make sure that Save Database Passwords is enabled on the General tab. (See the Section called Configuring Visual Explain's Operation.)

      For example, to configure a connection to the regression database, enter the following values:

      Nickname regression-db
      Database regression
      Host hostname
      Port 5432
      User Namepostgres
      Password password

      replacing hostname with the name of your database server.

  4. Click Test on the New Database window.

    • If the connection fails and the connection parameters you entered are correct, contact you System Administrator.

    • If the test passes, click OK on the Testing Database Connection window, on the New Database window, then click OK on the Configure window.

NoteModifying or Copying an Existing Database Connection
 

Modifying or copying an existing database connection is a similar to creating a new connection.

  • To modify an existing database connection, select the database connection you want to copy, then click on Edit rather than New.

  • To copy an existing database connection, select the database connection you want to edit, then click on Copy. A connection called Copy 1 of connection_name appears at the bottom of the list of connections. Select the Copy 1 of connection_name and click Edit and make the required changes.

Deleting a Connection to a Database

  1. On the Edit menu, click on Configuration. The Configure window appears.

  2. Click on the Databases tab.

  3. Select the database connection you want to delete, then click on Delete.