SYS_SERVERLESS_USAGE - Amazon Redshift

SYS_SERVERLESS_USAGE

Use SYS_SERVERLESS_USAGE to view details of Amazon Redshift Serverless usage of resources. This system view doesn't apply to provisioned Amazon Redshift clusters.

This view contains the serverless usage summary including how much compute capacity is used to process queries and the amount of Amazon Redshift managed storage used at a 1-minute granularity. The compute capacity is measured in Redshift processing units (RPUs) and metered for the workloads that you run in RPU-seconds on a per-second basis. RPUs are used to process queries on the data loaded in the data warehouse, queried from an Amazon S3 data lake, or accessed from operational databases using a federated query. Amazon Redshift Serverless retains the information in SYS_SERVERLESS_USAGE for 7 days.

For examples on compute cost billing, see Billing for Amazon Redshift Serverless.

SYS_SERVERLESS_USAGE is visible only to superusers. For more information, see Visibility of data in system tables and views.

Table columns

Column name Data type Description
start_time timestamp The time when the interval began.
end_time timestamp The time when the interval completed.
compute_seconds double precision The accumulated compute unit (RPU) seconds consumed during this time interval. This value accounts for the base RPU capacity allocated for the account.
compute_capacity double precision The average number of compute units (Redshift processing units, or RPUs) allocated during this time interval.

The compute_capacity value can be dynamically changed.

data_storage integer The average data storage space in MB used during this time interval.

Used data storage can change dynamically as data is loaded or deleted from the database.

cross_region_transferred_data integer

The accumulated data transferred for cross-Region data sharing in bytes during this time interval.

charged_seconds integer The accumulated compute unit (RPU) seconds charged during this time interval. This is computed after transactions end, and hence can be 0 while a transaction runs. Use charged_seconds to calculate cost for an Amazon Redshift Serverless workgroup. This value accounts for the RPU capacity allocated for the Amazon Redshift Serverless workgroup.

Usage notes

  • There are situations where compute_seconds is 0 but charged_seconds is greater than 0, or vice versa. This is normal behavior resulting from the way data is recorded in the system view. For a more accurate representation of serverless usage details, we recommend aggregating the data.

Example

To get the total charges for RPU hours used for a time interval by querying charged_seconds, run the following query:

select trunc(start_time) "Day", (sum(charged_seconds)/3600::double precision) * <Price for 1 RPU> as cost_incurred from sys_serverless_usage group by 1 order by 1

Note that there can be idle time during the interval. Idle time doesn't add to RPUs consumed.