

 Amazon Redshift 將不再支援從修補程式 198 開始建立新的 Python UDFs。現有 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\$1UNIQUE
<a name="r_STL_UNIQUE"></a>

分析在 SELECT 清單中使用 DISTINCT 函數時發生的執行步驟，或在 UNION 或 INTERSECT 查詢中複製或移除時發生的執行步驟。

所有使用者都可看見 STL\$1UNIQUE。超級使用者可以看見所有資料列；一般使用者只能看見自己的資料。如需詳細資訊，請參閱[系統資料表和檢視中資料的可見性](cm_chap_system-tables.md#c_visibility-of-data)。

**注意**  
STL\$1UNIQUE 僅包含在主佈建叢集上執行的查詢。但不包含在並行擴縮叢集上或無伺服器命名空間上執行的查詢。若要存取在主要叢集、並行擴縮叢集和無伺服器命名空間上執行的查詢說明計畫，建議您使用 SYS 監控檢視 [SYS\$1QUERY\$1DETAIL](SYS_QUERY_DETAIL.md)。SYS 監視檢視中的資料會格式化為更易於使用和理解。

## 資料表欄
<a name="r_STL_UNIQUE-table-columns"></a>

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

## 範例查詢
<a name="r_STL_UNIQUE-sample-queries"></a>

假設您執行下列查詢：

```
select distinct eventname
from event order by 1;
```

假設前一個查詢的 ID 為 6313，下列範例會顯示唯一步驟針對區段 0 與 1 中之每個配量所產生的資料列數目。

```
select query, slice, segment, step, datediff(msec, starttime, endtime) as msec, tasknum, rows 
from stl_unique where query = 6313
order by query desc, slice, segment, step;
```

```
 query | slice | segment | step | msec | tasknum | rows
-------+-------+---------+------+------+---------+------
  6313 |     0 |       0 |    2 |    0 |      22 |  550
  6313 |     0 |       1 |    1 |  256 |      20 |  145
  6313 |     1 |       0 |    2 |    1 |      23 |  540
  6313 |     1 |       1 |    1 |   42 |      21 |  127
  6313 |     2 |       0 |    2 |    1 |      22 |  540
  6313 |     2 |       1 |    1 |  255 |      20 |  158
  6313 |     3 |       0 |    2 |    1 |      23 |  542
  6313 |     3 |       1 |    1 |   38 |      21 |  146
(8 rows)
```