

 Amazon Redshift は、パッチ 198 以降、新しい Python UDF の作成をサポートしなくなります。既存の Python UDF は、2026 年 6 月 30 日まで引き続き機能します。詳細については、[ブログ記事](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/)を参照してください。

# SYS\_AUTO\_TABLE\_OPTIMIZATION
<a name="r_SYS_AUTO_TABLE_OPTIMIZATION"></a>

自動最適化用に定義されたテーブルに Amazon Redshift によって実行された自動アクションを記録します。

SYS\_AUTO\_TABLE\_OPTIMIZATION は、スーパーユーザーにのみ表示されます。詳細については、「[システムテーブルとビューのデータの可視性](cm_chap_system-tables.md#c_visibility-of-data)」を参照してください。

## テーブルの列
<a name="r_SYS_AUTO_TABLE_OPTIMIZATION-table-rows"></a>


| 列名  | データ型  | 説明  | 
| --- | --- | --- | 
| transaction\_id  | long | トランザクション識別子。 | 
| session\_id  | int  | alter コマンドを実行したプロセスのセッション識別子。 | 
| table\_id  | int  | テーブル識別子。 | 
| alter\_table\_type | character(32)  | レコメンデーションのタイプ。指定できる値は distkey、sortkey、および encode です。 | 
| ステータス  | character(128)  | レコメンデーションの完了ステータス。使用できる値は、Start、Complete、Skipped、Abort、Checkpoint、および Failed です。 | 
| event\_time  | timestamp  | ステータス列のタイムスタンプ。 | 
| alter\_from  | character(200)  | レコメンデーションを適用する前に、テーブルの以前のディストリビューションスタイルとソートキー。この値は 200 文字刻みの増分に切り捨てられます。 | 

## サンプルクエリ
<a name="r_SYS_AUTO_TABLE_OPTIMIZATION-sample-queries"></a>

次の例では、結果の行に 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   |
```