

# Analyzing metrics with the Performance Insights dashboard
<a name="USER_PerfInsights.UsingDashboard"></a>

**Important**  
 AWS has announced the end-of-life date for Performance Insights: June 30, 2026. After this date, Amazon RDS will no longer support the Performance Insights console experience, flexible retention periods (1-24 months), and their associated pricing. The Performance Insights API will continue to exist with no pricing changes. Costs for the Performance Insights API will appear in your AWS bill with the cost of CloudWatch Database Insights.   
 We recommend that you upgrade any DB clusters using the paid tier of Performance Insights to the Advanced mode of Database Insights before June 30, 2026. For information about upgrading to the Advanced mode of Database Insights, see [Turning on the Advanced mode of Database Insights for Amazon Aurora](USER_DatabaseInsights.TurningOnAdvanced.md).   
 If you take no action, DB clusters using Performance Insights will default to using the Standard mode of Database Insights. With Standard mode of Database Insights, you might lose access to performance data history beyond 7 days and might not be able to use execution plans and on-demand analysis features in the Amazon RDS console. After June 30, 2026 only the Advanced mode of Database Insights will support execution plans and on-demand analysis.   
 With CloudWatch Database Insights, you can monitor database load for your fleet of databases and analyze and troubleshoot performance at scale. For more information about Database Insights, see [Monitoring Amazon Aurora databases with CloudWatch Database Insights](USER_DatabaseInsights.md). For pricing information, see [Amazon CloudWatch Pricing](https://aws.amazon.com/cloudwatch/pricing/). 

The Performance Insights dashboard contains database performance information to help you analyze and troubleshoot performance issues. On the main dashboard page, you can view information about the database load. You can "slice" DB load by dimensions such as wait events or SQL.

**Topics**
+ [

# Overview of the Performance Insights dashboard
](USER_PerfInsights.UsingDashboard.Components.md)
+ [

# Accessing the Performance Insights dashboard
](USER_PerfInsights.UsingDashboard.Opening.md)
+ [

# Analyzing DB load by wait events
](USER_PerfInsights.UsingDashboard.AnalyzeDBLoad.md)
+ [

# Analyzing database performance for a period of time
](USER_PerfInsights.UsingDashboard.AnalyzePerformanceTimePeriod.md)
+ [

# Analyzing queries with the Top SQL tab in Performance Insights
](USER_PerfInsights.UsingDashboard.AnalyzeDBLoad.AdditionalMetrics.md)

# Overview of the Performance Insights dashboard
<a name="USER_PerfInsights.UsingDashboard.Components"></a>

The dashboard is the easiest way to interact with Performance Insights. The following example shows the dashboard for a PostgreSQL DB instance.

![\[Enable Performance Insights during DB instance creation with console\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/aurora_perf_insights_enabling.png)


**Topics**
+ [

## Time range filter
](#USER_PerfInsights.UsingDashboard.Components.time-range)
+ [

## Counter metrics chart
](#USER_PerfInsights.UsingDashboard.Components.Countermetrics)
+ [

## Database load chart
](#USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions)
+ [

## Top dimensions table
](#USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions.TopLoadItemsTable)

## Time range filter
<a name="USER_PerfInsights.UsingDashboard.Components.time-range"></a>

By default, the Performance Insights dashboard shows DB load for the last hour. You can adjust this range to be as short as 5 minutes or as long as 2 years. You can also select a custom relative range.

You can select an absolute range with a beginning and ending date and time. The following example shows the time range beginning at midnight on 9/25/24 and ending at 11:59 PM on 9/28/24.

By default, the time zone for the Performance Insights dashboard is Coordinated Universal Time (UTC). You can also choose the local time zone.

## Counter metrics chart
<a name="USER_PerfInsights.UsingDashboard.Components.Countermetrics"></a>

With counter metrics, you can customize the Performance Insights dashboard to include up to 10 additional graphs. These graphs show a selection of dozens of operating system and database performance metrics. You can correlate this information with DB load to help identify and analyze performance problems.

 The **Counter metrics** chart displays data for performance counters. The default metrics depend on the DB engine:
+ Aurora MySQL– `db.SQL.Innodb_rows_read.avg`
+ Aurora PostgreSQL – `db.Transactions.xact_commit.avg`

![\[Counter metrics\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/oracle_perf_insights_counters.png)


To change the performance counters, choose **Manage Metrics**. You can select multiple **OS metrics** or **Database metrics**, as shown in the following screenshot. To see details for any metric, hover over the metric name.

![\[Filter metrics\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_select_metrics.png)


For descriptions of the counter metrics that you can add for each DB engine, see [Performance Insights counter metrics](USER_PerfInsights_Counters.md).

## Database load chart
<a name="USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions"></a>

The **Database load** chart shows how the database activity compares to DB instance capacity as represented by the **Max vCPU** line. By default, the stacked line chart represents DB load as average active sessions per unit of time. The DB load is sliced (grouped) by wait states. 

![\[Database load\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_2.png)


### DB load sliced by dimensions
<a name="USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions.dims"></a>

You can choose to display load as active sessions grouped by any supported dimensions. The following table shows which dimensions are supported for the different engines.


| Dimension | Aurora PostgreSQL | Aurora MySQL | 
| --- | --- | --- | 
|  Host  |  Yes  |  Yes  | 
|  SQL  |  Yes  |  Yes  | 
|  User  |  Yes  |  Yes  | 
|  Waits  |  Yes  |  Yes  | 
|  Application  |  Yes  |  No  | 
|  Database  |  Yes  |  Yes  | 
|  Session type  |  Yes  |  No  | 

The following image shows the dimensions for a PostgreSQL DB instance.

![\[Filter metrics\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_2b.png)


### DB load details for a dimension item
<a name="USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions.item-details"></a>

To see details about a DB load item within a dimension, hover over the item name. The following image shows details for a SQL statement.

![\[Database load item details\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_2c.png)


To see details for any item for the selected time period in the legend, hover over that item.

![\[Time period details for DB load\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_3.png)


## Top dimensions table
<a name="USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions.TopLoadItemsTable"></a>

The Top dimensions table slices DB load by different dimensions. A dimension is a category or "slice by" for different characteristics of DB load. If the dimension is SQL, **Top SQL** shows the SQL statements that contribute the most to DB load.

![\[Top N dimensions\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_4c.png)


Choose any of the following dimension tabs.


| Tab | Description | Supported engines | 
| --- | --- | --- | 
|  Top SQL  |  The SQL statements that are currently running  |  All  | 
|  Top waits  |  The event for which the database backend is waiting  |  All  | 
|  Top hosts  |  The host name of the connected client  |  All  | 
|  Top users  |  The user logged in to the database  |  All  | 
|  Top applications  |  The name of the application that is connected to the database  |  Aurora PostgreSQL only  | 
|  Top session types  |  The type of the current session  | Aurora PostgreSQL only | 

To learn how to analyze queries by using the **Top SQL** tab, see [Overview of the Top SQL tab](USER_PerfInsights.UsingDashboard.AnalyzeDBLoad.AdditionalMetrics.md#USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions.TopLoadItemsTable.TopSQL).

# Accessing the Performance Insights dashboard
<a name="USER_PerfInsights.UsingDashboard.Opening"></a>

Amazon RDS provides a consolidated view of Performance Insights and CloudWatch metrics in the Performance Insights dashboard.

To access the Performance Insights dashboard, use the following procedure.

**To view the Performance Insights dashboard in the AWS Management Console**

1. Open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the left navigation pane, choose **Performance Insights**.

1. Choose a DB instance.

   For DB instances with Performance Insights turned on, you can also access the Performance Insights dashboard by choosing the **Sessions** item in the list of DB instances. Under **Current activity**, the **Sessions** item shows the database load in average active sessions over the last five minutes. The bar graphically shows the load. When the bar is empty, the DB instance is idle. As the load increases, the bar fills with blue. When the load passes the number of virtual CPUs (vCPUs) on the DB instance class, the bar turns red, indicating a potential bottleneck.  
![\[Filter metrics\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_0a.png)

1. (Optional) Choose the date or time range in the upper right and specify a different relative or absolute time interval. You can now specify a time period, and generate a database performance analysis report. The report provides the identified insights and recommendations. For more information, see [Creating a performance analysis report in Performance Insights](USER_PerfInsights.UsingDashboard.AnalyzePerformanceTimePeriod.md).  
![\[Filter metrics by time interval\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_0c.png)

   In the following screenshot, the DB load interval is 5 hours.  
![\[Set time interval to 5 hours\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_1.png)

1. (Optional) To zoom in on a portion of the DB load chart, choose the start time and drag to the end of the time period you want. 

   The selected area is highlighted in the DB load chart.  
![\[DB load for a specified time interval\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_zoom_in.png)

   When you release the mouse, the DB load chart zooms in on the selected AWS Region, and the **Top *dimensions*** table is recalculated.  
![\[Zoom in on the selected DB load\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_zoom_in_b.png)

1. (Optional) To refresh your data automatically, select **Auto refresh**.  
![\[Set automatic refresh\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_1b.png)

   The Performance Insights dashboard automatically refreshes with new data. The refresh rate depends on the amount of data displayed: 
   + 5 minutes refreshes every 10 seconds.
   + 1 hour refreshes every 5 minutes.
   + 5 hours refreshes every 5 minutes.
   + 24 hours refreshes every 30 minutes.
   + 1 week refreshes every day.
   + 1 month refreshes every day.

# Analyzing DB load by wait events
<a name="USER_PerfInsights.UsingDashboard.AnalyzeDBLoad"></a>

If the **Database load** chart shows a bottleneck, you can find out where the load is coming from. To do so, look at the top load items table below the **Database load** chart. Choose a particular item, like a SQL query or a user, to drill down into that item and see details about it.

DB load grouped by waits and top SQL queries is the default Performance Insights dashboard view. This combination typically provides the most insight into performance issues. DB load grouped by waits shows if there are any resource or concurrency bottlenecks in the database. In this case, the **SQL** tab of the top load items table shows which queries are driving that load.

Your typical workflow for diagnosing performance issues is as follows:

1. Review the **Database load** chart and see if there are any incidents of database load exceeding the **Max CPU** line.

1. If there is, look at the **Database load** chart and identify which wait state or states are primarily responsible.

1. Identify the digest queries causing the load by seeing which of the queries the **SQL** tab on the top load items table are contributing most to those wait states. You can identify these by the **DB Load by Wait** column.

1. Choose one of these digest queries in the **SQL** tab to expand it and see the child queries that it is composed of.

For example, in the dashboard following, **log file sync** waits account for most of the DB load. The **LGWR all worker groups** wait is also high. The **Top SQL** chart shows what is causing the **log file sync** waits: frequent `COMMIT` statements. In this case, committing less frequently will reduce DB load.

![\[log file sync errors\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_7.png)


# Analyzing database performance for a period of time
<a name="USER_PerfInsights.UsingDashboard.AnalyzePerformanceTimePeriod"></a>

Analyze database performance with on-demand analysis by creating a performance analysis report for a period of time. View performance analysis reports to find performance issues, such as resource bottlenecks or changes in a query in your DB instance. The Performance Insights dashboard allows you to select a time period and create a performance analysis report. You can also add one or more tags to the report. 

To use this feature, you must be using the paid tier retention period. For more information, see [Pricing and data retention for Performance Insights](USER_PerfInsights.Overview.cost.md)

The report is available in the **Performance analysis reports - new** tab to select and view. The report contains the insights, related metrics, and recommendations to resolve the performance issue. The report is available to view for the duration of Performance Insights retention period.

The report is deleted if the start time of the report analysis period is outside of the retention period. You can also delete the report before the retention period ends.

To detect the performance issues and generate the analysis report for your DB instance, you must turn on Performance Insights. For more information about turning on Performance Insights, see [Turning Performance Insights on and off for Aurora](USER_PerfInsights.Enabling.md). 

For the region, DB engine, and instance class support information for this feature, see [ Amazon Aurora DB engine, Region, and instance class support for Performance Insights features](USER_PerfInsights.Overview.Engines.md#USER_PerfInsights.Overview.PIfeatureEngnRegSupport)

In the following sections, you can create, view, add tags, and delete a performance analysis report.

**Topics**
+ [

# Creating a performance analysis report in Performance Insights
](USER_PerfInsights.UsingDashboard.CreatingPerfAnlysisReport.md)
+ [

# Viewing a performance analysis report in Performance Insights
](USER_PerfInsights.UsingDashboard.ViewPerfAnalysisReport.md)
+ [

# Adding tags to a performance analysis report in Performance Insights
](USER_PerfInsights.UsingDashboard.ManagePerfAnalysisReportTags.md)
+ [

# Deleting a performance analysis report in Performance Insights
](USER_PerfInsights.UsingDashboard.DeletePerfAnalysisReport.md)

# Creating a performance analysis report in Performance Insights
<a name="USER_PerfInsights.UsingDashboard.CreatingPerfAnlysisReport"></a>

You can create a performance analysis report for a specific period in the Performance Insights dashboard. You can select a time period and add one or more tags to the analysis report.

The analysis period can range from 5 minutes to 6 days. There must be at least 24 hours of performance data before the analysis start time.

For the region, DB engine, and instance class support information for this feature, see [ Amazon Aurora DB engine, Region, and instance class support for Performance Insights features](USER_PerfInsights.Overview.Engines.md#USER_PerfInsights.Overview.PIfeatureEngnRegSupport)

**To create a performance analysis report for a time period**

1. Open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the left navigation pane, choose **Performance Insights**.

1. Choose a DB instance. 

1. Choose **Analyze performance** in **Database load** section on the Performance Insights dashboard.

   The fields to set the time period and add one or more tags to the performance analysis report are displayed.  
![\[Performance Insights dashboard showing fields to create analysis report\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/PI_CreateAnalysisReport.png)

1. Choose the time period. If you set a time period in the **Relative range** or **Absolute range** in the upper right, you can only enter or select the analysis report date and time within this time period. If you select the analysis period outside of this time period, an error message displays.

    To set the time period, you can do any of the following:
   + Press and drag any of the sliders on the DB load chart.

     The **Performance analysis period** box displays the selected time period and DB load chart highlights the selected time period.
   + Choose the **Start date**, **Start time**, **End date**, and **End time** in the **Performance analysis period** box.  
![\[Performance Insights dashboard with analysis period selected\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/PI_CreateAnalysisRep_TimePeriod.png)

1. (Optional) Enter **Key** and **Value-*optional*** to add a tag for the report.  
![\[Performance Insights dashboard with fields to add a new tag\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/PI_CreateAnalysisRep_AddTag.png)

1. Choose **Analyze performance**.

   A banner displays a message whether the report generation is successful or failed. The message also provides the link to view the report.

   The following example shows the banner with the report creation successful message.  
![\[Analysis report creation successful message banner\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/PI_CreateAnaysisRep_SuccessMsg.png)

   The report is available to view in **Performance analysis reports - new** tab. 

You can create a performance analysis report using the AWS CLI. For an example on how to create a report using AWS CLI, see [Creating a performance analysis report for a time period](USER_PerfInsights.API.Examples.md#USER_PerfInsights.API.Examples.CreatePerfAnalysisReport).

# Viewing a performance analysis report in Performance Insights
<a name="USER_PerfInsights.UsingDashboard.ViewPerfAnalysisReport"></a>

The **Performance analysis reports - new** tab lists all the reports that are created for the DB instance. The following are displayed for each report:
+ **ID**: Unique identifier of the report.
+ **Name**: Tag key added to the report.
+ **Report creation time**: Time you created the report.
+ **Analysis start time**: Start time of the analysis in the report.
+ **Analysis end time**: End time of the analysis in the report.

**To view a performance analysis report**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the left navigation pane, choose **Performance Insights**.

1. Choose a DB instance for which you want to view the analysis report. 

1. Scroll down and choose **Performance analysis reports - new** tab in the Performance Insights dashboard.

   All the analysis reports for the different time periods are displayed.

1. Choose **ID** of the report you want to view.

   The DB load chart displays the entire analysis period by default if more than one insight is identified. If the report has identified one insight then the DB load chart displays the insight by default. 

   The dashboard also lists the tags for the report in the **Tags** section.

   The following example shows the entire analysis period for the report.  
![\[DB load chart showing entire analysis report period\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/PI_EntireAnalysisRep.png)

1. Choose the insight in the **Database load insights** list you want to view if more than one insight is identified in the report.

   The dashboard displays the insight message, DB load chart highlighting the time period of the insight, analysis and recommendations, and the list of report tags.

   The following example shows the DB load insight in the report.   
![\[DB load chart showing insight in the report\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/PI_AnalysisRepInsight_chart.png)  
![\[Report insight analysis and recommendation section\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/PI_AnalysisRepInsight_Recommendations.png)

# Adding tags to a performance analysis report in Performance Insights
<a name="USER_PerfInsights.UsingDashboard.ManagePerfAnalysisReportTags"></a>

You can add a tag when you create or view a report. You can add up to 50 tags for a report.

You need permissions to add the tags. For more information about the access policies for Performance Insights, see [Configuring access policies for Performance Insights](USER_PerfInsights.access-control.md)

To add one or more tags while creating a report, see step 6 in the procedure [Creating a performance analysis report in Performance Insights](USER_PerfInsights.UsingDashboard.CreatingPerfAnlysisReport.md).

**To add one or more tags when viewing a report**

1. Open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the left navigation pane, choose **Performance Insights**.

1. Choose a DB instance. 

   The Performance Insights dashboard appears for the DB instance.

1. Scroll down and choose **Performance analysis reports - new** tab.

1. Choose the report for which you want to add the tags.

   The dashboard displays the report.

1. Scroll down to **Tags** and choose **Manage tags**.

1. Choose **Add new tag**.

1. Enter the **Key** and **Value - *optional***, and choose **Add new tag**.

   The following example provides the option to add a new tag for the selected report.  
![\[Manage Tags window to add new tags to the report\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/PI_AddTag_ManageTags.png)

   A new tag is created for the report.

   The list of tags for the report is displayed in the **Tags** section on the dashboard. If you want to remove a tag from the report, choose **Remove** next to the tag.

# Deleting a performance analysis report in Performance Insights
<a name="USER_PerfInsights.UsingDashboard.DeletePerfAnalysisReport"></a>

You can delete a report from the list of reports displayed in the **Performance analysis reports** tab or while viewing a report. 

**To delete a report**

1. Open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the left navigation pane, choose **Performance Insights**.

1. Choose a DB instance. 

   The Performance Insights dashboard appears for the DB instance.

1. Scroll down and choose **Performance analysis reports - new** tab.

1. Select the report you want to delete and choose **Delete** in the upper right.  
![\[Performance Insights dashboard to delete with a report selected for deletion\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/PI_DeleteAnalysisRep.png)

   A confirmation window is displayed. The report is deleted after you choose confirm.

1. (Optional) Choose **ID** of the report you want to delete.

   In the report page, choose **Delete** in the upper right.

   A confirmation window is displayed. The report is deleted after you choose confirm.

# Analyzing queries with the Top SQL tab in Performance Insights
<a name="USER_PerfInsights.UsingDashboard.AnalyzeDBLoad.AdditionalMetrics"></a>

In the Amazon RDS Performance Insights dashboard, you can find information about running and recent queries in the **Top SQL** tab in the **Top dimensions** table. You can use this information to tune your queries.

**Topics**
+ [

## Overview of the Top SQL tab
](#USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions.TopLoadItemsTable.TopSQL)
+ [

# Accessing more SQL text in the Performance Insights dashboard
](USER_PerfInsights.UsingDashboard.SQLTextSize.md)
+ [

# Viewing SQL statistics in the Performance Insights dashboard
](USER_PerfInsights.UsingDashboard.AnalyzeDBLoad.AdditionalMetrics.AnalyzingSQLLevel.md)

## Overview of the Top SQL tab
<a name="USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions.TopLoadItemsTable.TopSQL"></a>

By default, the **Top SQL** tab shows the 25 queries that are contributing the most to DB load. To help tune your queries, you can analyze information such as the query text and SQL statistics. You can also choose the statistics that you want to appear in the **Top SQL** tab.

**Topics**
+ [

### SQL text
](#USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions.TopLoadItemsTable.TopSQL.text)
+ [

### SQL statistics
](#USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions.TopLoadItemsTable.TopSQL.statistics)
+ [

### Load by waits (AAS)
](#USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions.TopLoadItemsTable.TopSQL.Load-by-waits)
+ [

### View SQL information
](#USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions.TopLoadItemsTable.TopSQL.SQL-information)
+ [

### Choose statistics preferences
](#USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions.TopLoadItemsTable.TopSQL.Preferences)

### SQL text
<a name="USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions.TopLoadItemsTable.TopSQL.text"></a>

By default, each row in the **Top SQL** table shows 500 bytes of text for each statement. 

![\[SQL text\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/sql-text-apg.png)


To learn how to see more than the default 500 bytes of SQL text, see [Accessing more SQL text in the Performance Insights dashboard](USER_PerfInsights.UsingDashboard.SQLTextSize.md).

A *SQL digest* is a composite of multiple actual queries that are structurally similar but might have different literal values. The digest replaces hardcoded values with a question mark. For example, a digest might be `SELECT * FROM emp WHERE lname= ?`. This digest might include the following child queries:

```
SELECT * FROM emp WHERE lname = 'Sanchez'
SELECT * FROM emp WHERE lname = 'Olagappan'
SELECT * FROM emp WHERE lname = 'Wu'
```

To see the literal SQL statements in a digest, select the query, and then choose the plus symbol (\$1). In the following example, the selected query is a digest.

![\[Selected SQL digest\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_4b.png)


**Note**  
A SQL digest groups similar SQL statements, but doesn't redact sensitive information.

### SQL statistics
<a name="USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions.TopLoadItemsTable.TopSQL.statistics"></a>

*SQL statistics* are performance-related metrics about SQL queries. For example, Performance Insights might show executions per second or rows processed per second. Performance Insights collects statistics for only the most common queries. Typically, these match the top queries by load shown in the Performance Insights dashboard. 

Every line in the **Top SQL** table shows relevant statistics for the SQL statement or digest, as shown in the following example.

![\[Top SQL\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_4.png)


Performance Insights can report `0.00` and `-` (unknown) for SQL statistics. This situation occurs under the following conditions:
+ Only one sample exists. For example, Performance Insights calculates rates of change for Aurora PostgreSQL queries based on multiple samples from the `pg_stat_statements` view. When a workload runs for a short time, Performance Insights might collect only one sample, which means that it can't calculate a rate of change. The unknown value is represented with a dash (`-`).
+ Two samples have the same values. Performance Insights can't calculate a rate of change because no change has occurred, so it reports the rate as `0.00`.
+ An Aurora PostgreSQL statement lacks a valid identifier. PostgreSQL creates a identifier for a statement only after parsing and analysis. Thus, a statement can exist in the PostgreSQL internal in-memory structures with no identifier. Because Performance Insights samples internal in-memory structures once per second, low-latency queries might appear for only a single sample. If the query identifier isn't available for this sample, Performance Insights can't associate this statement with its statistics. The unknown value is represented with a dash (`-`).

For a description of the SQL statistics for the Aurora engines, see [SQL statistics for Performance Insights](sql-statistics.md).

### Load by waits (AAS)
<a name="USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions.TopLoadItemsTable.TopSQL.Load-by-waits"></a>

In **Top SQL**, the **Load by waits (AAS)** column illustrates the percentage of the database load associated with each top load item. This column reflects the load for that item by whatever grouping is currently selected in the **DB Load Chart**. For more information about Average active sessions (AAS), see [Average active sessions](USER_PerfInsights.Overview.ActiveSessions.md#USER_PerfInsights.Overview.ActiveSessions.AAS).

For example, you might group the **DB load** chart by wait states. You examine SQL queries in the top load items table. In this case, the **DB Load by Waits** bar is sized, segmented, and color-coded to show how much of a given wait state that query is contributing to. It also shows which wait states are affecting the selected query.

![\[DB load by waits\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_6.png)


### View SQL information
<a name="USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions.TopLoadItemsTable.TopSQL.SQL-information"></a>

In the **Top SQL** table, you can open a statement to view its information. The information appears in the bottom pane.

![\[Top SQL table with literal query selected\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf-insights-sql-ids-open.png)


The following types of identifiers (IDs) that are associated with SQL statements:
+ **Support SQL ID** – A hash value of the SQL ID. This value is only for referencing a SQL ID when you are working with AWS Support. AWS Support doesn't have access to your actual SQL IDs and SQL text.
+ **Support Digest ID** – A hash value of the digest ID. This value is only for referencing a digest ID when you are working with AWS Support. AWS Support doesn't have access to your actual digest IDs and SQL text.

### Choose statistics preferences
<a name="USER_PerfInsights.UsingDashboard.Components.AvgActiveSessions.TopLoadItemsTable.TopSQL.Preferences"></a>

You can control the statistics displayed in the **Top SQL** tab by choosing the **Preferences** icon.

![\[Statistics preferences\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf-insights-sql-ids-preferences-icon.png)


When you choose the **Preferences** icon, the **Preferences** window opens. The following screenshot is an example of the **Preferences** window.

![\[Preferences window\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf-insights-sql-ids-preferences.png)


To enable the statistics that you want to appear in the **Top SQL** tab, use your mouse to scroll to the bottom of the window, and then choose **Continue**. 

For more information about per-second or per-call statistics for the Aurora engines, see the engine specific SQL statistics section in [SQL statistics for Performance Insights](sql-statistics.md)

# Accessing more SQL text in the Performance Insights dashboard
<a name="USER_PerfInsights.UsingDashboard.SQLTextSize"></a>

By default, each row in the **Top SQL** table shows 500 bytes of SQL text for each SQL statement.

![\[500 bytes of SQL\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf-insights-top-sql-bytes.png)


When a SQL statement exceeds 500 bytes, you can view more text in the **SQL text** section below the **Top SQL** table. In this case, the maximum length for the text displayed in **SQL text** is 4 KB. This limit is introduced by the console and is subject to the limits set by the database engine. To save the text shown in **SQL text**, choose **Download**.

**Topics**
+ [

## Text size limits for Aurora MySQL
](#sql-text-engine-limits)
+ [

# Setting the SQL text limit for Aurora PostgreSQL DB instances
](USER_PerfInsights.UsingDashboard.SQLTextLimit.md)
+ [

# Viewing and downloading SQL text in the Performance Insights dashboard
](view-download-text.md)

## Text size limits for Aurora MySQL
<a name="sql-text-engine-limits"></a>

When you download SQL text, the database engine determines its maximum length. You can download SQL text up to the following per-engine limits.


| DB engine | Maximum length of downloaded text | 
| --- | --- | 
| Aurora MySQL | The length is fixed at 4,096 bytes. | 

The **SQL text** section of the Performance Insights console displays up to the maximum that the engine returns. For example, if Aurora MySQL returns at most 1 KB to Performance Insights, it can only collect and show 1 KB, even if the original query is larger. Thus, when you view the query in **SQL text** or download it, Performance Insights returns the same number of bytes.

If you use the AWS CLI or API, Performance Insights doesn't have the 4 KB limit enforced by the console. `DescribeDimensionKeys` and `GetResourceMetrics` return at most 500 bytes. 

**Note**  
`GetDimensionKeyDetails` returns the full query, but the size is subject to the engine limit.

# Setting the SQL text limit for Aurora PostgreSQL DB instances
<a name="USER_PerfInsights.UsingDashboard.SQLTextLimit"></a>

Aurora PostgreSQL handles text differently. You can set the text size limit with the DB instance parameter `track_activity_query_size`. This parameter has the following characteristics:

Default text size  
On Aurora PostgreSQL version 9.6, the default setting for the `track_activity_query_size` parameter is 1,024 bytes. On Aurora PostgreSQL version 10 or higher, the default is 4,096 bytes.

Maximum text size  
The limit for `track_activity_query_size` is 102,400 bytes for Aurora PostgreSQL version 12 and lower. The maximum is 1 MB for version 13 and higher.   
If the engine returns 1 MB to Performance Insights, the console displays only the first 4 KB. If you download the query, you get the full 1 MB. In this case, viewing and downloading return different numbers of bytes. For more information about the `track_activity_query_size` DB instance parameter, see [Run-time Statistics](https://www.postgresql.org/docs/current/runtime-config-statistics.html) in the PostgreSQL documentation.

To increase the SQL text size, increase the `track_activity_query_size` limit. To modify the parameter, change the parameter setting in the parameter group that is associated with the Aurora PostgreSQL DB instance.

**To change the setting when the instance uses the default parameter group**

1. Create a new DB instance parameter group for the appropriate DB engine and DB engine version.

1. Set the parameter in the new parameter group.

1. Associate the new parameter group with the DB instance.

For information about setting a DB instance parameter, see [Modifying parameters in a DB parameter group in Amazon Aurora](USER_WorkingWithParamGroups.Modifying.md).

# Viewing and downloading SQL text in the Performance Insights dashboard
<a name="view-download-text"></a>

In the Performance Insights dashboard, you can view or download SQL text.

**To view more SQL text in the Performance Insights dashboard**

1. Open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Performance Insights**.

1. Choose a DB instance.

1. Scroll down to the **Top SQL** tab in the Performance Insights dashboard.

1. Choose the plus sign to expand a SQL digest and choose one of the digest's child queries.

   SQL statements with text larger than 500 bytes look similar to the following image.  
![\[SQL statements with large text\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf-insights-large-text-aurora-1.png)

1. Scroll down to the **SQL text** tab.  
![\[SQL information section shows more of the SQL text\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf-insights-large-text-aurora-2.png)

   The Performance Insights dashboard can display up to 4,096 bytes for each SQL statement.

1. (Optional) Choose **Copy** to copy the displayed SQL statement, or choose **Download** to download the SQL statement to view the SQL text up to the DB engine limit.
**Note**  
To copy or download the SQL statement, disable pop-up blockers. 

# Viewing SQL statistics in the Performance Insights dashboard
<a name="USER_PerfInsights.UsingDashboard.AnalyzeDBLoad.AdditionalMetrics.AnalyzingSQLLevel"></a>

In the Performance Insights dashboard, SQL statistics are available in the **Top SQL** tab of the **Database load** chart.

**To view SQL statistics**

1. Open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the left navigation pane, choose **Performance Insights**.

1. At the top of the page, choose the database whose SQL statistics you want to see.

1. Scroll to the bottom of the page and choose the **Top SQL** tab.

1. Choose an individual statement (Aurora MySQL only) or digest query.  
![\[Viewing metrics for running queries\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_per_sql_digest.png)

1. Choose which statistics to display by choosing the gear icon in the upper-right corner of the chart. For descriptions of the SQL statistics for the Amazon RDSAurora engines, see [SQL statistics for Performance Insights](sql-statistics.md).

   The following example shows the preferences for Aurora PostgreSQL.  
![\[Preferences for metrics for running queries for Aurora PostgreSQL DB instances\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_per_sql_pref_apg.png)

   The following example shows the preferences for Aurora MySQL DB instances.  
![\[Preferences for metrics for running queries for Aurora MySQL DB instances.\]](http://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/images/perf_insights_per_sql_pref_ams.png)

1. Choose Save to save your preferences.

   The **Top SQL** table refreshes.