Every query that is executed in Redshift has explained information collected and stored in explaining tables and in system tables. The exception to this is when using the Explain prefix in front of the query as in the following example:

EXPLAIN SELECT * FROM  svl_qlog

In this case, explain information is not generated. Only a plan is generated because the query is not executed. The plan describes the access path that will get used when the query is executed. It only shows the plan that Redshift will execute if the query is run under current operating conditions. If you change the schema or data for a table and run the analyze command again to update the statistical metadata, the query plan might be different. 
 
The visual explain information displayed in Aqua Data Studio is a compilation of the collected explain information stored in the explain and system tables. The tables used are:

Contents

Vendor-Specific Information


Aqua Data Studio queries these tables and summarizes the steps used in the access path. Costing, duration, and memory usage are some of the information returned in the summarized steps. Here is a list of the information that is returned:

Cost is a measure that compares the relative execution times of the steps within a plan. Cost does not provide any precise information about actual execution times or memory consumption, nor does it provide a meaningful comparison between execution plans. It does give you an indication of which operations in a query are consuming the most resources.

Executing Visual Explain in Aqua Data Studio

In Query Analyzer

Show Execution Plan Button

Turning ON this button during normal query execution will return the query data result set as well as the visual explain execution plan with a diagram. The execution plan contains the actual cost for running the query.

Execute Explain Button

The information returned for this query execution will be a text version of the explain plan and not the visual explain plan grid with a diagram. In this case, no data is returned because the query is never executed. The plan describes the access path that will get used when the query is executed. It only shows the plan that Redshift will execute if the query is run under current operating conditions. If you change the schema or data for a table and run the analyze command again to update the statistical metadata, the query plan might be different. 

In DBA Tools Instance Manager

Query History


Displays a list of queries. This list is based on your filter selection. Notice the type drop-down at the top of the list panel which shows type equal “Query” initially. There is also an “Execution Plan” tab on the bottom pane. Clicking on this tab will execute a query to gather explain information already stored in the database and display a plan with an explain diagram for the selected query. You can scroll through the query list and look at the execution plan for each query by clicking on the “Execution Plan” tab. Changing the type at the top of the page will return different result lists.