

 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\_ANALYZE\_COMPRESSION\_HISTORY
<a name="r_SYS_ANALYZE_COMPRESSION_HISTORY"></a>

COPY または ANALYZE COMPRESSION コマンドの実行中に圧縮分析オペレーションの詳細を記録します。

SYS\_ANALYZE\_COMPRESSION\_HISTORY はすべてのユーザーに表示されます。スーパーユーザーはすべての行を表示できますが、通常のユーザーは自分のデータのみを表示できます。詳細については、「[システムテーブルとビューのデータの可視性](cm_chap_system-tables.md#c_visibility-of-data)」を参照してください。

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


| 列名  | データ型  | 説明  | 
| --- | --- | --- | 
| user\_id | integer | エントリを生成したユーザーの ID。 | 
| start\_time | timestamp | 圧縮分析オペレーションを開始した時刻。 | 
| transaction\_id | bigint | 圧縮分析オペレーションのトランザクション ID。 | 
| table\_id | integer | 分析されたテーブルのテーブル ID。 | 
| table\_name | character(128) | 分析されたテーブルの名前。 | 
| column\_position | integer | 圧縮エンコードを決定するために分析されたテーブルの列のインデックス。 | 
| old\_encoding | character(15) | 圧縮分析前のエンコードタイプ。 | 
| new\_encoding | character(15) | 圧縮分析後のエンコードタイプ。 | 
| mode | character(14) | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/redshift/latest/dg/r_SYS_ANALYZE_COMPRESSION_HISTORY.html)  | 

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

次の例では、同じセッションで実行された最後の COPY コマンドで、`lineitem` テーブルの圧縮分析の詳細を検査します。

```
select transaction_id, table_id, btrim(table_name) as table_name, column_position, old_encoding, new_encoding, mode 
from sys_analyze_compression_history
where transaction_id = (select transaction_id from sys_query_history where query_id = pg_last_copy_id()) order by column_position;
                
 transaction_id  |  table_id   | table_name | column_position |  old_encoding   |  new_encoding   |      mode
-----------------+-------------+------------+-----------------+-----------------+-----------------+-------------
      8196       |   248126    | lineitem   |        0        | mostly32        | mostly32        | ON
      8196       |   248126    | lineitem   |        1        | mostly32        | lzo             | ON
      8196       |   248126    | lineitem   |        2        | lzo             | delta32k        | ON
      8196       |   248126    | lineitem   |        3        | delta           | delta           | ON
      8196       |   248126    | lineitem   |        4        | bytedict        | bytedict        | ON
      8196       |   248126    | lineitem   |        5        | mostly32        | mostly32        | ON
      8196       |   248126    | lineitem   |        6        | delta           | delta           | ON
      8196       |   248126    | lineitem   |        7        | delta           | delta           | ON
      8196       |   248126    | lineitem   |        8        | lzo             | zstd            | ON
      8196       |   248126    | lineitem   |        9        | runlength       | zstd            | ON
      8196       |   248126    | lineitem   |       10        | delta           | lzo             | ON
      8196       |   248126    | lineitem   |       11        | delta           | delta           | ON
      8196       |   248126    | lineitem   |       12        | delta           | delta           | ON
      8196       |   248126    | lineitem   |       13        | bytedict        | zstd            | ON
      8196       |   248126    | lineitem   |       14        | bytedict        | zstd            | ON
      8196       |   248126    | lineitem   |       15        | text255         | zstd            | ON
(16 rows)
```