

 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/)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# WLM 系統資料表和檢視
<a name="cm-c-wlm-system-tables-and-views"></a>

WLM 會根據內部定義的 WLM 服務類別來設定查詢佇列。Amazon Redshift 會根據這些服務類別以及 WLM 組態中定義的佇列，建立多個內部佇列。在系統資料表中，*佇列*和*服務類別*這兩個詞通常互通使用。超級使用者佇列使用服務類別 5。使用者定義的查詢使用服務類別 6 以上。

您可以使用 WLM 專屬系統資料表來檢視查詢、佇列和服務類別的狀態。查詢下列系統資料表來執行下列動作：
+ 檢視工作負載管理員正在追蹤哪些查詢及已配置什麼資源。
+ 查看已將查詢指派給哪一個佇列。
+ 檢視工作負載管理員目前追蹤之查詢的狀態。

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/redshift/latest/dg/cm-c-wlm-system-tables-and-views.html)

 您可以在系統資料表中使用任務 ID 來追蹤查詢。以下範例示範如何取得最近提交之使用者查詢的任務 ID：

```
select task from stl_wlm_query where exec_start_time =(select max(exec_start_time) from stl_wlm_query); 

task 
------ 
137 
(1 row)
```

 下列範例顯示目前正在執行或在各種服務類別 (佇列) 中等待的查詢。此查詢很適用於追蹤 Amazon Redshift 的整體並行工作負載：

```
select * from stv_wlm_query_state order by query;


xid |task|query|service_| wlm_start_  |  state  |queue_ | exec_
    |    |     |class   | time        |         |time   | time
----+----+-----+--------+-------------+---------+-------+--------
2645| 84 | 98  | 3      | 2010-10-... |Returning|   0   | 3438369
2650| 85 | 100 | 3      | 2010-10-... |Waiting  |   0   | 1645879
2660| 87 | 101 | 2      | 2010-10-... |Executing|   0   | 916046
2661| 88 | 102 | 1      | 2010-10-... |Executing|   0   | 13291
(4 rows)
```

## WLM 服務類別 ID
<a name="wlm-service-class-ids"></a>

下表列出指派給服務類別的 ID。

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/redshift/latest/dg/cm-c-wlm-system-tables-and-views.html)