

 从补丁 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/)。

# STV\$1PARTITIONS
<a name="r_STV_PARTITIONS"></a>

使用 STV\$1PARTITIONS 表可了解 Amazon Redshift 的磁盘速度性能和磁盘利用率。

STV\$1PARTITIONS 中的一行对应每个节点的一个逻辑磁盘卷。

STV\$1PARTITIONS 仅对超级用户可见。有关更多信息，请参阅 [系统表和视图中的数据可见性](cm_chap_system-tables.md#c_visibility-of-data)。

## 表列
<a name="r_STV_PARTITIONS-table-rows2"></a>

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

## 示例查询
<a name="r_STV_PARTITIONS-sample-query2"></a>

以下查询返回已用磁盘空间和容量（1 MB 磁盘块数），并计算磁盘利用率（占原始磁盘空间的百分比）。原始磁盘空间包括 Amazon Redshift 保留供内部使用的空间，因此它大于名义磁盘容量（可供用户使用的磁盘空间量）。Amazon Redshift 管理控制台的**性能**选项卡上的**已用磁盘空间百分比**指标报告集群使用的名义磁盘容量的百分比。建议您监控 **Percentage of Disk Space Used** 指标以维持集群的名义磁盘容量的使用量。

**重要**  
我们强烈建议您不要超过集群的名义磁盘容量。尽管这在某些情况下在技术上可能是可行的，但超过名义磁盘容量会降低集群的容错能力并增加丢失数据的风险。

此示例是在两个节点组成的集群上运行的（每个节点有六个逻辑磁盘分区）。各磁盘的空间使用非常平均，每个磁盘大约使用 25%。

```
select owner, host, diskno, used, capacity,
(used-tossed)/capacity::numeric *100 as pctused 
from stv_partitions order by owner;

 owner | host | diskno |  used  | capacity | pctused
-------+------+--------+--------+----------+---------
   0   |  0   |    0   | 236480 |  949954  | 24.9
   0   |  0   |    1   | 236420 |  949954  | 24.9
   0   |  0   |    2   | 236440 |  949954  | 24.9
   0   |  1   |    2   | 235150 |  949954  | 24.8
   0   |  1   |    1   | 237100 |  949954  | 25.0
   0   |  1   |    0   | 237090 |  949954  | 25.0
   1   |  1   |    0   | 236310 |  949954  | 24.9
   1   |  1   |    1   | 236300 |  949954  | 24.9
   1   |  1   |    2   | 236320 |  949954  | 24.9
   1   |  0   |    2   | 237910 |  949954  | 25.0
   1   |  0   |    1   | 235640 |  949954  | 24.8
   1   |  0   |    0   | 235380 |  949954  | 24.8 

(12 rows)
```