statement_timeout - Amazon Redshift
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

statement_timeout

Values (default in bold)

0 (turns off limitation), x milliseconds

Description

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_execution_time) and a QMR (query_execution_time), which include only execution time.

If WLM timeout (max_execution_time) is also specified as part of a WLM configuration, the lower of statement_timeout and max_execution_time is used. For more information, see WLM timeout.

Example

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

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