Analyzing query execution - Amazon Redshift
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Analyzing query execution

You can analyze the execution details of a query to understand how it performed and identify potential areas for optimization. Analyzing a query provides insights into the query plan, including the steps involved, the time taken by each step, and the amount of data processed. Common use cases include troubleshooting slow-running queries, optimizing data distribution strategies, and identifying opportunities for query rewriting or indexing.

To analyze a query
  1. Sign in to the Amazon Web Services Management Console and open the Amazon Redshift console at https://console.amazonaws.cn/redshiftv2/.

  2. On the navigation menu, choose Queries and loads to display the list of queries for your account. You might need to change settings on this page to find your query.

  3. Choose the Query identifier in the list to display Query details.

    The Query details page includes Query details and Query plan tabs with metrics about the query.

    Note

    You can also navigate to the Query details page from a Cluster details page, Query history tab when you drill down into a query in a Query runtime graph.

The Query details page contains the following sections:

  • A list of Rewritten queries, as shown in the following screenshot.

    Table showing a list of rewritten queries, with attributes such as start time, duration, status, and query ID as the column names.
  • A Query details section, as shown in the following screenshot.

    The query details section in the console showing attributes for a specific query.
  • A Query details tab that contains the SQL that was run and Execution details about the run.

  • A Query plan tab that contains the Query plan steps and other information about the query plan. This table also contains graphs about the cluster when the query ran.

    • Cluster health status

      The cluster health status section of the console showing the cluster health during the workload.
    • CPU utilization

      The CPU utilization section in the console showing a line graph of CPU utilization of the cluster in increments of minutes.
    • Storage capacity used

      The storage capacity used section in the console showing a line graph of the percent of stoage capacity used in increments of minutes.
    • Active database connections

      The active database connections section in the console showing a line graph of the number of active database connections to the cluster over time.