SYS_AUTO_TABLE_OPTIMIZATION - Amazon Redshift
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

SYS_AUTO_TABLE_OPTIMIZATION

记录 Amazon Redshift 对自动优化定义的表执行的自动操作。

SYS_AUTO_TABLE_OPTIMIZATION 仅对超级用户可见。有关更多信息,请参阅 系统表和视图中的数据可见性

表列

列名称 数据类型 描述
transaction_id long 事务标识符。
session_id int 执行 Alter 命令的进程的标识符。
table_id int 表标识符。
alter_table_type character(32) 建议的类型。可能的值为 distkeysortkeyencode
status character(128) 建议的完成状态。可能的值包括 StartCompleteSkippedAbortCheckpointFailed
event_time 时间戳 状态列的时间戳。
alter_from character(200) 应用建议之前表的上一个分配方式和排序键。该值被截断为 200 个字符的增量。
alter_to character(200) 应用建议后表的当前分配方式和排序键。该值被截断为 200 个字符的增量。

示例查询

在以下示例中,结果中的行显示了由 Amazon Redshift 执行的操作。

SELECT table_id, alter_table_type, status, event_time, alter_from FROM SYS_AUTO_TABLE_OPTIMIZATION; table_id | alter_table_type | status | event_time | alter_from ----------+---------------------+------------------------------------------------------+-----------------------------+----------------- 118082 | sortkey | Start | 2020-08-22 19:42:20.727049 | 118078 | sortkey | Start | 2020-08-22 19:43:54.728819 | 118082 | sortkey | Start | 2020-08-22 19:42:52.690264 | 118072 | sortkey | Start | 2020-08-22 19:44:14.793572 | 118082 | sortkey | Failed | 2020-08-22 19:42:20.728917 | 118078 | sortkey | Complete | 2020-08-22 19:43:54.792705 | SORTKEY: None; 118086 | sortkey | Complete | 2020-08-22 19:42:00.72635 | SORTKEY: None; 118082 | sortkey | Complete | 2020-08-22 19:43:34.728144 | SORTKEY: None; 118072 | sortkey | Skipped:Retry exceeds the maximum limit for a table. | 2020-08-22 19:44:46.706155 | 118086 | sortkey | Start | 2020-08-22 19:42:00.685255 | 118082 | sortkey | Start | 2020-08-22 19:43:34.69531 | 118072 | sortkey | Start | 2020-08-22 19:44:46.703331 | 118082 | sortkey | Checkpoint: progress 14.755079% | 2020-08-22 19:42:52.692828 | 118072 | sortkey | Failed | 2020-08-22 19:44:14.796071 | 116723 | sortkey | Abort:This table is not AUTO. | 2020-10-28 05:12:58.479233 | 110203 | distkey | Abort:This table is not AUTO. | 2020-10-28 05:45:54.67259 |