System tables and views for Amazon Redshift queries - AWS Prescriptive Guidance

System tables and views for Amazon Redshift queries

System tables and views often hold information that can help you troubleshoot issues with your queries. For example, you can use system tables and views to figure out why some queries are hanging or why some queries are running longer than others. Here are some of the most commonly used views:

  • STL_QUERY – Returns execution information about a database query

  • STL_QUERY_METRICS – Contains metrics information (such as the number of rows processed, CPU usage, input/output, and disk use) for queries that run in user-defined query queues

  • STL_QUERYTEXT – Captures the query text for SQL commands

  • STL_TR_CONFLICT – Logs lock conflicts

  • STL_BCAST – Logs information about network activity during execution of query steps that broadcast data

For more information about system tables and views, see STL views for logging in the Amazon Redshift documentation.