

 从补丁 198 开始，Amazon Redshift 将不再支持创建新的 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/)。

# STL\$1ANALYZE\$1COMPRESSION
<a name="r_STL_ANALYZE_COMPRESSION"></a>

记录在 COPY 或 ANALYZE COMPRESSION 命令期间压缩分析操作的详细信息。

STL\$1ANALYZE\$1COMPRESSION 对所有用户可见。超级用户可以查看所有行；普通用户只能查看其自己的数据。有关更多信息，请参阅 [系统表和视图中的数据可见性](cm_chap_system-tables.md#c_visibility-of-data)。

此表中的部分或全部数据也可以在 SYS 监控视图 [SYS\$1ANALYZE\$1COMPRESSION\$1HISTORY](r_SYS_ANALYZE_COMPRESSION_HISTORY.md) 中找到。SYS 监控视图中的数据经过格式化处理，便于使用和理解。我们建议您使用 SYS 监控视图进行查询。

## 表列
<a name="r_STL_ANALYZE_COMPRESSION-table-columns2"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/redshift/latest/dg/r_STL_ANALYZE_COMPRESSION.html)

## 示例查询
<a name="r_STL_ANALYZE_COMPRESSION-sample-queries2"></a>

以下示例检查在同一个会话中运行的最后一个 COPY 命令对 `lineitem` 表执行压缩分析的详细信息。

```
select xid, tbl, btrim(tablename) as tablename, col, old_encoding, new_encoding, best_compression_encoding, mode 
from stl_analyze_compression 
where xid = (select xid from stl_query where query = pg_last_copy_id()) order by col;

 xid  |  tbl   | tablename | col |  old_encoding   |  new_encoding   | best_compression_encoding |      mode      
------+--------+-----------+-----+-----------------+-----------------+---------------------------+----------------
 5308 | 158961 | $lineitem |   0 | mostly32        | az64            | delta                     | ON            
 5308 | 158961 | $lineitem |   1 | mostly32        | az64            | az64                      | ON            
 5308 | 158961 | $lineitem |   2 | lzo             | az64            | az64                      | ON            
 5308 | 158961 | $lineitem |   3 | delta           | az64            | az64                      | ON            
 5308 | 158961 | $lineitem |   4 | bytedict        | az64            | bytedict                  | ON            
 5308 | 158961 | $lineitem |   5 | mostly32        | az64            | az64                      | ON            
 5308 | 158961 | $lineitem |   6 | delta           | az64            | az64                      | ON            
 5308 | 158961 | $lineitem |   7 | delta           | az64            | az64                      | ON            
 5308 | 158961 | $lineitem |   8 | lzo             | lzo             | lzo                       | ON            
 5308 | 158961 | $lineitem |   9 | runlength       | runlength       | runlength                 | ON            
 5308 | 158961 | $lineitem |  10 | delta           | az64            | az64                      | ON            
 5308 | 158961 | $lineitem |  11 | delta           | az64            | az64                      | ON            
 5308 | 158961 | $lineitem |  12 | delta           | az64            | az64                      | ON            
 5308 | 158961 | $lineitem |  13 | bytedict        | bytedict        | bytedict                  | ON            
 5308 | 158961 | $lineitem |  14 | bytedict        | bytedict        | bytedict                  | ON            
 5308 | 158961 | $lineitem |  15 | text255         | text255         | text255                   | ON   
(16 rows)
```