

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

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

# statement\$1timeout
<a name="r_statement_timeout"></a>

## 值 (粗體為預設值)
<a name="r_statement_timeout-values"></a>

 **0 (關閉限制)**、x 毫秒

## Description
<a name="r_statement_timeout-description"></a>

停止任何超過指定毫秒數的陳述式。

`statement_timeout` 值是指查詢在 Amazon Redshift 將其終止前可執行的最長時間。這個時間包括規劃、排入工作負載管理 (WLM) 佇列，以及執行時間。比較這個時間和 WLM 逾時 (max\$1execution\$1time) 和 QMR (query\$1execution\$1time)，其中包含唯一的執行時間。

如果 WLM 組態中也指定了 WLM 逾時 (max\$1execution\$1time)，則會使用 statement\$1timeout 和 WLM 逾時 (max\$1execution\$1time) 之中較小者。如需詳細資訊，請參閱[WLM 逾時](cm-c-defining-query-queues.md#wlm-timeout)。

## 範例
<a name="r_statement_timeout-example"></a>

以下查詢因為時間超過 1 毫秒，所以會逾時並被取消。

```
set statement_timeout = 1;

select * from listing where listid>5000;
ERROR:  Query (150) canceled on user's request
```