Menu
Amazon Redshift
Database Developer Guide (API Version 2012-12-01)

STL_ANALYZE

Records details for ANALYZE operations.

This table is visible only to superusers. For more information, see Visibility of Data in System Tables and Views.

Table Columns

Column Name Data Type Description
userid integer ID of the user who generated the entry.
xid long Transaction ID.
database char(30) Database name.
table_id integer Table ID.
status char(15) Result of the analyze command. Possible values are Full,Skipped or PredicateColumn.
rows double Total number of rows in the table.
modified_rows double Total number of rows that were modified since the last ANALYZE operation.
threshold_percent integer Value of the analyze_threshold_percent parameter.
is_auto char(1) Value that indicates whether the analysis was executed automatically (t) or by the user (f).
starttime timestamp Time in UTC that the ANALYZE operation started executing.
endtime timestamp Time in UTC that the ANALYZE operation finished executing.
prevtime timestamp Time in UTC that the table was previously analyzed.
num_predicate_cols integer Current number of predicate columns in the table.
num_new_predicate_cols integer Number of new predicate columns in the table since the previous ANALYZE operation.

Sample Queries

The following example joins STV_TBL_PERM to show the table name and execution details.

Copy
select distinct a.xid, trim(t.name) as name, a.status, a.rows, a.modified_rows, a.starttime, a.endtime from stl_analyze a join stv_tbl_perm t on t.id=a.table_id where name = 'users' order by starttime; xid | name | status | rows | modified_rows | starttime | endtime -------+-------+-----------------+-------+---------------+---------------------+-------------------- 1582 | users | Full | 49990 | 49990 | 2016-09-22 22:02:23 | 2016-09-22 22:02:28 244287 | users | Full | 24992 | 74988 | 2016-10-04 22:50:58 | 2016-10-04 22:51:01 244712 | users | Full | 49984 | 24992 | 2016-10-04 22:56:07 | 2016-10-04 22:56:07 245071 | users | Skipped | 49984 | 0 | 2016-10-04 22:58:17 | 2016-10-04 22:58:17 245439 | users | Skipped | 49984 | 1982 | 2016-10-04 23:00:13 | 2016-10-04 23:00:13 (5 rows)