Skip to content

sys.log_analyze

This view records a history of analyze operations on tables (auto-analyze and manually run commands).

Column NameData TypeDescription
table_idbigintThe unique ID for the table. Tables in different schemas within the same database may have the same name, so you can use this ID to uniquely identify a table.
database_idbigintUnique database ID.
user_idbigintUnique ID of the user who ran the analyze command.
start_timetimestamptzWhen the analyze command started running.
end_timetimestamptzWhen the analyze command completed its execution.
rowsbigintThe number of rows in the table when the command was run.
rows_analyzedbigintThe number of rows that were scanned in order to update statistics for the table.

Example

premdb=# select * from sys.log_analyze;
 table_id | database_id | user_id |          start_time           |           end_time            | rows | rows_analyzed 
----------+-------------+---------+-------------------------------+-------------------------------+------+---------------
   16884 |       16874 |   16006 | 2017-06-19 14:17:09.448803-07 | 2017-06-19 14:17:11.427635-07 |   50 |            50
   16881 |       16874 |   16006 | 2017-06-19 14:17:11.431026-07 | 2017-06-19 14:17:13.376706-07 |   50 |            50
   16893 |       16874 |   16006 | 2017-06-19 15:37:15.650933-07 | 2017-06-19 15:37:16.972667-07 |    1 |             1
   16887 |       16874 |      10 | 2017-06-19 17:54:36.917482-07 | 2017-06-19 17:54:42.338015-07 |    0 |             0
   16887 |       16874 |      10 | 2017-06-20 12:49:15.774682-07 | 2017-06-20 12:49:20.240464-07 | 8606 |           172
(5 rows)

Note: Internal system users have five-digit user IDs that begin with 16.

Parent topic:System Views