

 Amazon Redshift will no longer support the creation of new Python UDFs starting Patch 198. Existing Python UDFs will continue to function until June 30, 2026. For more information, see the [ blog post ](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>

## Values (default in bold)
<a name="r_statement_timeout-values"></a>

 **0 (turns off limitation)**, x milliseconds

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

Stops any statement that takes over the specified number of milliseconds.

The `statement_timeout` value is the maximum amount of time a query can run before Amazon Redshift terminates it. This time includes planning, queueing in workload management (WLM), and execution time. Compare this time to WLM timeout (max\$1execution\$1time) and a QMR (query\$1execution\$1time), which include only execution time.

If WLM timeout (max\$1execution\$1time) is also specified as part of a WLM configuration, the lower of statement\$1timeout and max\$1execution\$1time is used. For more information, see [WLM timeout](cm-c-defining-query-queues.md#wlm-timeout).

## Example
<a name="r_statement_timeout-example"></a>

Because the following query takes longer than 1 millisecond, it times out and is canceled.

```
set statement_timeout = 1;

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