

 从补丁 198 开始，Amazon Redshift 将不再支持创建新的 Python UDF。现有的 Python UDF 将继续正常运行至 2026 年 6 月 30 日。有关更多信息，请参阅[博客文章](https://www.amazonaws.cn/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/)。

# STL\$1SAVE
<a name="r_STL_SAVE"></a>

包含查询中的*保存* 步骤的详细信息。保存步骤将输入流保存到一个临时表。临时表是查询执行期间存储中间结果的临时表。

一个查询包含多个区段，而且每个区段包含一个或多个步骤。有关更多信息，请参阅 [查询处理](c-query-processing.md)。

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

**注意**  
STL\$1SAVE 仅包含在主预置集群上运行的查询。它不包含在并发扩展集群或无服务器命名空间上运行的查询。要访问在主集群、并发扩展集群和无服务器命名空间上运行的查询的解释计划，我们建议您使用 SYS 监控视图 [SYS\$1QUERY\$1DETAIL](SYS_QUERY_DETAIL.md)。SYS 监控视图中的数据经过格式化处理，便于使用和理解。

## 表列
<a name="w2aac59c29b9c99c13"></a>

[\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/redshift/latest/dg/r_STL_SAVE.html)

## 示例查询
<a name="r_STL_SAVE-sample-queries"></a>

以下查询显示最近查询中在每个切片上执行的保存步骤。

```
select query, slice, segment, step, tasknum, rows,  tbl  
from stl_save where query = pg_last_query_id();

 query | slice | segment | step | tasknum | rows | tbl
-------+-------+---------+------+---------+------+-----
 52236 |     3 |       0 |    2 |      21 |    0 | 239
 52236 |     2 |       0 |    2 |      20 |    0 | 239
 52236 |     2 |       2 |    2 |      20 |    0 | 239
 52236 |     3 |       2 |    2 |      21 |    0 | 239
 52236 |     1 |       0 |    2 |      21 |    0 | 239
 52236 |     0 |       0 |    2 |      20 |    0 | 239
 52236 |     0 |       2 |    2 |      20 |    0 | 239
 52236 |     1 |       2 |    2 |      21 |    0 | 239
(8 rows)
```